-->
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: parent - child update
PostPosted: Wed May 02, 2007 9:01 am 
Newbie

Joined: Wed May 02, 2007 8:56 am
Posts: 1
I have an object with these properties:

private Long idMenu;
private String otherProperties;
.
.
private Set roles = new LinkedHashSet();


And this mapping:

<hibernate-mapping default-lazy="false">
<class name="portalbcn.Menu" table="menu">
<id name="idMenu" column="idMenu">
<generator class="native"/>
</id>
.
.
<set name="roles" table="menu_role">
<key column="idMenu" />
<many-to-many class="portalbcn.Role" column="idRole" />
</set>
</class>
</hibernate-mapping>



In my application I have a form in which I modifiy the properties of the menu object and then save it to the database,
but I have no information about its roles in this form.

The problem is that the roles set of the menu object is null when I save the menu object, so all its dependent registers in

menu_role table are removed from the database.

Is the a way to avoid this?, I only need the roles set to retrieve information, not to update it.


Thank you,

Óscar.


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.