Reworked Hibernate data access.