First working example of a hibernate way of using the database.