-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Why when using composite-element Id generator not executed?
PostPosted: Mon Sep 13, 2004 1:07 pm 
Newbie

Joined: Thu Aug 12, 2004 9:32 am
Posts: 17
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 ???????


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.