Hibernate version:2.1.6
Hi,
I use composite-element to map a Hashmap object. (my Hashmap contains (string-idx, class-value).
when i save the class by itself it generates the id fine.
when i use parent and save it, is goes well
but it doesn't generates the child's id !!!!
can someone help me understand that ????
p.s
( the child id is a database column only not property of class)
here is mapping :
PARENT
Code:
<class name="ProcessDefinition" table="ProcessDefinition">
<id type="string" unsaved-value="null" access="field">
<column name="Process_Def_ID" sql-type="char(32)" not-null="true"/>
<generator class="uuid.hex"/>
</id>
<property name="processId"
...
...
<map name="taskDefinitionMap" table="TASKDEFINITION">
<key column="Process_Def_ID"/>
<index column="taskId" type="string"/>
<composite-element class="TaskDefinition">
<property name="condition"....
<property name="name" .....
<property name="oneAtTime" .....
....
....
</composite-element>
</map>
</class>
CHILD
Code:
<class name="TaskDefinition" table="TaskDefinition">
<id type="string" access="field">
<column name="Task_Def_ID" sql-type="char(32)"/>
<generator class="uuid.hex"/>
</id>
<property name="taskId" ...
<property name="condition"...
<property name="name"...
<property name="oneAtTime"...
...
...
</class>
when i use :
ProcessDefinition pd = new ProcessDefinition();
TaskDefinition td = new TaskDefinition();
pd.putTaskDefinition(td);
storage1.saveObject(pd);
it inserts NULL to task_def_id column .....
why ???????