-->
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: begginer persisting an instance
PostPosted: Wed Sep 09, 2009 7:53 am 
Newbie

Joined: Wed Sep 09, 2009 7:45 am
Posts: 1
Hello, I'm kind of a begginer with hibernate and I have a "problem" when I persist an object.
I have the following mapping:

Code:
<hibernate-mapping  package="com.du.security.domain">
   <class name="Role" table="ROLE">
            ...      
       <set name="permissions" table="ROLE_PERMISSIONS" cascade="save-update">
           <key column="ROLE_ID"/>
           <many-to-many
               class="Feature"
               column="FEATURE_ID"/>
       </set>
   </class>
</hibernate-mapping>


I'm tring to add a new Role just by having at my disposal some Feature ids.
What would be the best way to do this?
Loading each Feature instance (to get a proxy?) using the feature id that I have and adding them to the new Role instance permission collections?


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.