Fixed hibernate 4 compatibility.