Hibernate + DAO changes

Hey Oz, here are the changes that I emailed you about.