-->
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.  [ 3 posts ] 
Author Message
 Post subject: Update Question
PostPosted: Thu May 20, 2004 10:07 pm 
Regular
Regular

Joined: Tue Oct 14, 2003 11:11 pm
Posts: 62
Location: Brasil/Curitiba
Hi,

I

_________________
Ricardo Lecheta


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 8:29 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
You don't need to load POJO before update them.
If you populate the good key Hibernate manage the update alone.
But could you give us more details for mapping files or source files.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 10:11 am 
Regular
Regular

Joined: Tue Oct 14, 2003 11:11 pm
Posts: 62
Location: Brasil/Curitiba
subich wrote:
If you populate the good key Hibernate manage the update alone.


I know. I don't have my mapping files now, but I will try to explain for you.

I have a User.hbm.xml and Group.hbm.xml.
In User.java has a "Collection groups".

In my WebWork Action, I have the save() and getUser() methods.

Quote:
public class Action. implements Action
{
private User user = new User();
public void save(){
session.saveOrUpdate(user);
// Will this delete all groups from this User?
}
// get/set to User
}



WebWork will instanciete a new object User, then this object has a Collection groups=null. Then, Hibernate will delete all groups.

Because this, I'm loading a object with same primary key from database.

any idea?

Thank you

_________________
Ricardo Lecheta


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