-->
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.  [ 2 posts ] 
Author Message
 Post subject: managing list of update
PostPosted: Tue May 24, 2005 4:58 am 
Newbie

Joined: Tue May 24, 2005 4:49 am
Posts: 2
Hello,

My problem is the following.
I have a table which contains 2 columns : a key and a label.
In my application there is a screen with a form containing all the couple [key-label] and empty input text to have the possibility to add new couple [key-label].
I would like to know if there is a way to perform automatically the update of the full list.
For example I would like to have a method of the type:
updateList(List oldList,List newList) with:
oldList the old list of couples
newList the new list of couples
And that automatically do the following task:
insert the new couples (those that are in the newlist and not in the oldlist)
update the existing couple
delete the couples that are not in the new list and that were in the old list.


Any help would be really great.
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 24, 2005 9:19 am 
Senior
Senior

Joined: Sun Mar 14, 2004 10:16 am
Posts: 129
Location: Ankara
I wonder how can u manage to map it and start to talk about this "updateList" method. Do not forget hibernate methods are related to your mappings!!!

If you mapped that Class only, you should call saveOrUpdate for each of that class instance in the list by one and one.


If another class has list of that couples and you mapped both classes, then you can handle this via using <many-to-one association , cascade and unsaved-value properties.

_________________
-developer


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.