Hi, i'm new with Hibernate and want to use a existing datamodel in Hibernate
Tabel: ST (ID = Primary Key) -------- ID
Table: DD (ST_ID + NUMBER = Primary Key) --------- ST_ID NUMBER
Table: VALUE (ST_ID + DD_NUMBER + ROWNR = Primary Key) --------- ST_ID DD_NUMBER ROWNR
Relation: ST one-many DD one-many VALUE
In my domain
Class StamTable long id; Set<DataDictionary> dds;
Class DataDictionary long st_id; long number; Set<RowValue> rowvalues;
Class RowValue int rownr String value;
Now i want to map it with a set and composite like this
<class name="StamTable" table="ST" > <id name="id"><generator class="sequence"/></id> <set name="dds" table="DD"> <key column="ST_ID"> <composite-element class="DataDictionary"> <property name="number" not-null="true" /> </composite-element > </class>
<class name="DataDictionary" table="DD"> <composite-id> <key-property name="st_id" /> <key-property name="number" /> </composite-id>
<set name="rowvalues" table="VALUE"> <key> <column name="ST_ID"> <column name="DD_NUMBER"> </key>
<composite-element class="RowValue"> <property name="rownr" not-null="true" /> </composite-element > </class>
When i now make a StamTable, DataDictionary and RowValue object and save only the StamTable only a ST record and DD record get's inserted, not a VALUE record.
What can i do?
Regards,
Jeroen Wolff
|