-->
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.  [ 5 posts ] 
Author Message
 Post subject: saveOrUpdate()
PostPosted: Wed May 03, 2006 11:50 am 
Regular
Regular

Joined: Mon Jun 13, 2005 12:38 pm
Posts: 56
Location: Austin, TX
Why is there a 2nd saveOrUpdate method that takes two arguments:

public void saveOrUpdate(Object object) throws HibernateException

public void saveOrUpdate(String entityName, Object object) throws HibernateException

Why would anyone want to specifically use the second one?

thanks,
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 03, 2006 10:56 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
I think that it's for use with the DOM model, rather than the POJO one. The object you pass in is always going to be the same class (Element, I think), so you use the entity name to discriminate.

There's no need to use any of the methods with entityName parameters if you're working with a pure POJO model.

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 11:52 am 
Regular
Regular

Joined: Mon Jun 13, 2005 12:38 pm
Posts: 56
Location: Austin, TX
Could you point to where that might be in the documentation? I saw some things about DOM4J, but it doesn't really discuss the saveOrUpdate methods.


thanks,
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 12:50 pm 
Expert
Expert

Joined: Tue Apr 25, 2006 12:04 pm
Posts: 260
I think the second one is used for getting specific EntityPersister {using entityName as key} from SessionFactory.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 7:09 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Chapter 18 is the one about XML data. That's the relevant part.

_________________
Code tags are your friend. Know them and use them.


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