Fixed for hibernate 4.