-->
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: Assigned IDs
PostPosted: Wed Apr 05, 2006 1:01 am 
Newbie

Joined: Thu Feb 02, 2006 7:09 pm
Posts: 8
Hi,

I have a column in a table where the key is provided by a third party. This key is guarenteed to be unique and I tend to get a lot of rows to upload in one go (many thousands).

If I create the new object to be persistent, and then try to save it, then hibernate will automatically try to select the object out of the database to decide whether or not to update or save it.

Is there a way that I can specify that an object is new when saving, in order to prevent that select?

Thanks for the help,

George


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 05, 2006 8:48 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Using the Hibernate Session.save method does not to the extra select check your talking about. In anycase, ideally primary domain object using assigned variables should have a version field and this version field should indicate an unsave value (usually 0).


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.