Functionality implemented using Hibernate (badly, my first go) for ORM.