Some code snippets using Hibernate