-->
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.  [ 4 posts ] 
Author Message
 Post subject: Question about generators and PostgreSQL
PostPosted: Fri Apr 13, 2007 1:02 pm 
Newbie

Joined: Fri Apr 13, 2007 12:54 pm
Posts: 8
There is a doubt I have regarding the generator tag on the mapping file.

If in PostgreSQL I use generator="native" will I need the id of the table to be of type "SERIAL" or can I declare it as an integer and then hibernate will generate the ids for the table?


Top
 Profile  
 
 Post subject: native hibernateive post
PostPosted: Sat Apr 14, 2007 3:15 am 
Newbie

Joined: Fri Apr 13, 2007 8:38 am
Posts: 12
yes, It will generate for u,


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 14, 2007 8:56 pm 
Senior
Senior

Joined: Tue Mar 09, 2004 2:38 pm
Posts: 141
Location: Lowell, MA USA
It will work, and you can also declare the type a Integer, Long, or BigInteger.

Ryan-

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

Please remember to rate!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 14, 2007 11:11 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  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.