-->
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: Code/Function for Updating All Objects at once
PostPosted: Mon Jan 31, 2011 12:11 pm 
Newbie

Joined: Mon Jan 31, 2011 12:04 pm
Posts: 1
Hello everybody,

Can you please help me following:

I have got 50 records (Objects) from Table.
I need to update 25 of them and rest will be unchanged.
I need to persist then All these 50 records again.

Should I call update method for each object separately after I have got a List by Query.list() function and I am iterating through them and updating those.

OR

Is there some function to which I can pass List of Objects to persist in DB.

Thanks & Regards,
Asim Imtiaz Bhatti


Top
 Profile  
 
 Post subject: Re: Code/Function for Updating All Objects at once
PostPosted: Mon Jan 31, 2011 1:44 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Assuming that all work is done in a single Session, Hibernate should automatically pick up changes you have made to your objects. Usually you don't have to do anything special except committing the transaction when you are finished.


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.