Hi there,
When, in a hbm, i have a reference to a subclass in a <Set a cannot use the superclasses table fields in the where property of the Set. Is there any way for me reference the superclass table or something like where="super.prop1=123"?
For reference, my mapping files look like this:
The reference to the subclass:
Code:
<set name="subItems" lazy="true" table="SUBITEMS" where="prop1=123">
<key>
<column name="id" />
<column name="version" />
</key>
<one-to-many class="com.sample.SubItem" />
</set>
The subclass mapping file :
Code:
<hibernate-mapping package="com.sample">
<joined-subclass name="SubItem" table="SUBITEM" extends="com.sample.Item">
<key>
<column name="id" />
<column name="version" />
</key>
<property name="name" column="NAME" type="string" not-null="false" length="255" />
</joined-subclass>
</hibernate-mapping>
The superclass mapping file:
Code:
<hibernate-mapping>
<class name="com.sample.Item" table="ITEM">
<composite-id name="id" class="com.sample.Sample$Id" access="field">
<key-property name="id" />
<key-property name="version" />
</composite-id>
<property name="prop1" column="prop1" type="integer" />
</class>
</hibernate-mapping>
Any Ideas?
Thanks in advanced