Am using "Table per concrete class with unions" hibernate mapping strategy. Each child is saved in a different table and the ids have to start from 1 sequentially. Is there a way for each the children to have different generators?
The mapping file:-
Code:
<hibernate-mapping>
<class name="test.Bl" abstract="true">
<id name="id" column="ID" type="integer">
<generator class="sequence">
<param name="sequence">SQ_ID</param>
</generator>
</id>
<property name="consignee" column="CONSIGNEE" type="string" />
<union-subclass name="test.SeaBl"
table="TMP_SEA_BL">
<property name="blNo" column="BL_NO" />
</union-subclass>
<union-subclass name="test.Awb" table="TMP_AWB">
<property name="awbNo" column="AWB" />
</union-subclass>
</class>
</hibernate-mapping>
I wanted every child to have its own <id> and consequently generator, but i realize the construct is not allowed in the case above, i.e. can't have <id> inside union-subclass.
NB: The generator is an Oracle sequence.