Hibernate 4 compatibility

Made the project compile with hibernate 4.1.0 as a provided dependency.