Hibernate related stuff
Attention, this code will not work correctly!