I'm trying to map two concrete classes with an abstract base class, and be able to bulk load from XML.
The issue I'm hitting is that my XML has different attributes for the item id, and there appears to be no way to specify this in my mapping document using either union-subclass or joined-subclass
Hibernate version:
Hibernate 3 production version.
Mapping documents:
Here is approximately what I'm trying to do:
<pre>
<class name="com.ioko.iod.bean.item.AbstractItem">
<id name="id" column="id">
<generator class="assigned"/>
</id>
<property name="title" not-null="true" node="Title"/>
<property name="description" node="Synopsis"/>
<union-subclass name="com.ioko.iod.bean.item.ProgramItem" table="program_info" node="ProgramInformation">
<key column="program_id"/> <!-- key not allowed here -->
</union-subclass>
<union-subclass name="com.ioko.iod.bean.item.GroupItem" table="group_info" node="GroupInformation">
<key column="group_id"/>
<property name="type" node="@Type"/>
</joined-subclass>
</class>
</pre>
Name and version of the database you are using:
HSQLDB
Is this possible. I'm going to try it with an additional generated id and see if it works that way, but not ideal.
Alfie.
|