Fix problem with Hibernate lazy loading

When using Hibernate with lazy loading, the fields of the HibernateProxy
might be not initialized (i.e. set to null).
In order to get the values, the getters should be used instead of directly
accessing the fields.
Merge branch 'hibernate-proxy'