Hibernate version:
Hibernate 2.1.4
Mapping documents:
Code:
<class name="PrincipalVO" table="principals" mutable="true" polymorphism="implicit" dynamic-update="false" dynamic-insert="false" batch-size="1" select-before-update="false" optimistic-lock="version">
<meta attribute="extends" inherit="false">AbstractPrincipalVO</meta>
<id unsaved-value="null" column="id" type="java.lang.Integer" name="id">
<generator class="native"/>
</id>
<joined-subclass table="roles" name="RoleVO">
<key foreign-key="id" column="f_principal"/>
<set name="users" lazy="true" table="users_roles" sort="unsorted" batch-size="1" outer-join="auto" inverse="true">
<key>
<column name="f_roles"/>
</key>
<many-to-many class="UserVO" outer-join="auto">
<column name="f_users"/>
</many-to-many>
</set>
<many-to-one name="group" class="GroupVO" not-null="true" unique="false" outer-join="auto" update="true" insert="true">
<column name="f_groups"/>
</many-to-one>
</joined-subclass>
</class>
<class name="GroupVO" table="groups" mutable="true" polymorphism="implicit" dynamic-update="false" dynamic-insert="false" batch-size="1" select-before-update="false" optimistic-lock="version">
<id unsaved-value="null" column="id" type="java.lang.Integer" name="id">
<generator class="native"/>
</id>
<set name="roles" lazy="true" inverse="true" cascade="none" sort="unsorted" batch-size="1" outer-join="auto">
<key>
<column name="f_groups"/>
</key>
<one-to-many class="RoleVO"/>
</set>
</class>
Name and version of the database you are using:
MySQL 4.1
The problem is that, although all RoleVO objects roles are related with a group in the database, calling getGroup() on any RoleVO object returns null and it's just a simple getter as produced by hbm2java. Can anyone please tell me what i'm missing?
Thanks,
Manos