-->
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: Hibernate3 MySQL best id generator
PostPosted: Wed Apr 09, 2008 5:11 am 
Newbie

Joined: Tue Sep 26, 2006 10:51 am
Posts: 6
Location: Berlin, Germany
Hi,
I develop application with MySQL DB (5.x).
My question is what is the best method to auto generate ID?

Now I use GenerationType.AUTO but I think also about GenerationType.TABLE. Can you give me some hints, please?
Do you know any drawbacks of GenerationType.AUTO and GenerationType.TABLE ?

Thanks in advance
Albert

_________________
Albert Gorski agorski(at/)gmx(dot/)net


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 09, 2008 6:58 am 
Newbie

Joined: Wed Apr 09, 2008 4:19 am
Posts: 3
Hello

GenerationType.AUTO will use AUTO_INCREMENT feature for MySQL

GenerationType.TABLE will create special table and will store current id generators values in rows here

I suggest to use GenerationType.AUTO.

More info
http://edocs.bea.com/kodo/docs41/full/html/ejb3_overview_mapping_sequence.html
http://java.sun.com/javaee/5/docs/api/javax/persistence/GenerationType.html

Thanks,
illya


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.