-->
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.  [ 3 posts ] 
Author Message
 Post subject: Ternary mapping not cascading.
PostPosted: Wed Sep 10, 2003 1:28 pm 
Regular
Regular

Joined: Wed Sep 03, 2003 9:56 pm
Posts: 58
Hi,

I have a ternary mapping based on a <map/> (see below). When I save the User object, I get the following error,

Code:
net.sf.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: Group


If I manually save the added Groups before adding them to the map, then saving the User works fine. The cascading save of the Roles seems to work fine.

Any suggestions?

Thanks,
-Mitch

Here is the mapping,
Code:
<class name="User" table="SEC_USER">
    ...
    <map name="groupRoles" cascade="all" table="SEC_USER_GROUP_ROLE">
        <key column="USER_ID"/>
        <index-many-to-many column="GROUP_ID" class="Group"/>
        <many-to-many column="ROLE_ID" class="Role"/>
    </map>
</class>


which maps to tables,

Code:
SEC_USER--oSEC_USER_GROUP_ROLEo--SEC_GROUP
                  o
                  |
              SEC_ROLE
[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 10, 2003 2:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
cascade save dies not apply to map indexes. sorry :(


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 19, 2003 3:04 am 
Newbie

Joined: Mon Nov 17, 2003 1:51 am
Posts: 16
Is this going to be added in the future? If not, is there a particular reason (performance) that it's not implemented.


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

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.