-->
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: list with inverse="true"
PostPosted: Fri Jun 01, 2007 1:12 am 
Beginner
Beginner

Joined: Thu May 17, 2007 2:41 pm
Posts: 48
there seems to be some confusion as to whether version 3 does support list with inverse="true" without manually taking care of index.

I have the follow parent child, User - Event

<hibernate-mapping default-lazy="false" >
<class name="model.User" >
<id name="userId" type="int" column="USERID">
<generator class="native" />
</id>

<list name="events" cascade="all-delete-orphan" inverse="true" >
<key column="USERID" not-null="true" />
<list-index column="eventsIdx"/>
<one-to-many class="model.Event"/>
</list>

</class>

</hibernate-mapping>

<hibernate-mapping >

<class name="model.Event" >
<id name="objectId" type="int" column="OBJECTID">
<generator class="native" />
</id>

<many-to-one name="user" class="model.User" column="USERID" not-null="true" />
<property name="location" column="LOCATION" />

</class>

</hibernate-mapping>

after adding a new Event to User, I can save by either the parent of the child, but eventsIdx is NULL.

Please tell me whether this mapping is correct for hibernate 3.2.


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.