Hi
Hibernate version:
2.1.8
Mapping documents:
Extra attributes left out ...
Code:
<hibernate-mapping>
<class name="OrderHeader" table="CMOHDP" schema="CDTA111">
<id name="ohdId" column="ID_OHD" type="int" unsaved-value="0">
<generator class="identity"></generator>
</id>
<version name="version" type="integer" column="RECVER"/>
<property name="cliNo" type="int" column="CLI_NO"/>
<joined-subclass name="SheetOrderHeader" table="CMSOHP"
schema="CDTA111" >
<key column="ID_OHD"/>
<property name="palletStyle" type="java.lang.String"column="PALLET_STYLE"/>
</joined-subclass>
</class>
</hibernate-mapping>
Name and version of the database you are using:
DB2 on AS/400 V5R2
I have a table schema as such:
Table A
ID_OHD INTEGER -- PK (Indentity type)
RECVER INTEGER -- Used for optimistic locking
CLI_NO -- Arbitraty field
Table B
ID_OHD INTEGER -- PK, FK (refering to TABLE A.ID_OHD)
RECVER INTEGER -- Used for optimistic locking
PALLET_STYLE -- Arbitraty field
These tables can be modified by an external source such as an RPG program.
Table B has a one-to-one mapping with table A (Table A being the master)
I have mapped this as a joinned subclass (OrderHeader being an abstract base class).
My problem is that I cannot define a <version> element inside the <joined-subclass> element.
However I do require that on update the A.RECVER as well as B.RECVER be included in their corresponding statements.
Is there another way to map this. I cannot change the tables but I can let go of the AbstractBaseClass and SubClass notion and create a composite...
Thanks in advance.