Adding Hibernate functionality to getting data from DB