-->
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: one last question
PostPosted: Sat Apr 14, 2007 11:00 pm 
Newbie

Joined: Fri Apr 13, 2007 12:54 pm
Posts: 8
Is it a good practice or will performance be better if I use a SERIAL datatype as an Id?

What does Hibernate do to generate the Id? Does it do a Select MAX to get the new Id?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 14, 2007 11:13 pm 
Senior
Senior

Joined: Tue Mar 09, 2004 2:38 pm
Posts: 141
Location: Lowell, MA USA
Quote:
Is it a good practice or will performance be better if I use a SERIAL datatype as an Id?


That would depend on what database you are using. I have used Oracle, MySQL, and PostgreSQL and have never seen anything significant.


Quote:
What does Hibernate do to generate the Id? Does it do a Select MAX to get the new Id?


This all depends on what ID generator you choose along with what database you are using. There are SEVERAL ID generators available in Hibernate:

http://www.hibernate.org/hib_docs/v3/re ... aration-id

Ryan-

_________________
Ryan J. McDonough
http://damnhandy.com

Please remember to rate!


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.