-->
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: update entity with lazy collection
PostPosted: Sat Sep 29, 2012 3:33 am 
Regular
Regular

Joined: Thu Jun 16, 2011 12:03 pm
Posts: 94
Hi all,

I have an entity with a lazy collection. If i want to update this entity i lose the collection.

I have been trying several things like this one:

Code:
// just pseudocode...to try to understand my problem
udpate (entity){
      originalEntity = find (entity.id);
      copyproperties (entity, originalEntity);
      merge(originalEntity);
}


The basic idea was to modify the properties of my entity and get the collection from the session. Maybe this is not the correct way of doing this. I have been searching on forums and maybe i have to fecth the collection.

I also tried with update method but it does not work.

Is there any other way of updating entities with lazy collection? any tutorial with code examples?

Thanks in advance,


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.