making example work on Java 5 and Hibernate 3