-->
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.  [ 7 posts ] 
Author Message
 Post subject: suitable id generator to use?
PostPosted: Wed Nov 17, 2004 4:11 pm 
Beginner
Beginner

Joined: Thu Oct 14, 2004 10:53 pm
Posts: 45
general question.

I'd like to know what ID generator is the best to use in this situation.

Consider this. I have to develop against both Oracle 10g and SQL Server 2000. So I would like to avoid using both Identity and Sequence at the same time. I don't want to use increment since it is not thread-safe, and I can't use the hilo ones since I have an app server running JTA. My id columns are long types so I cannot use the UUID generators. What options do I have?

Any assisstance appreciated

[b]Hibernate version:2.1.6[/b]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 4:12 pm 
Beginner
Beginner

Joined: Thu Oct 14, 2004 10:53 pm
Posts: 45
btw, I probably cannot use native since my key columns aren't flagged as Identifier columns.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 4:12 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
"native"

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 4:13 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Implement your own IdentifierGenerator.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 4:14 pm 
Beginner
Beginner

Joined: Thu Oct 14, 2004 10:53 pm
Posts: 45
can you show me some example code of a custom generator and how this can be invoked from the mapping file?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 4:16 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Please have a look at the existing IdentifierGenerators in Hibernate.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 5:55 pm 
Beginner
Beginner

Joined: Thu Oct 14, 2004 10:53 pm
Posts: 45
i noted a quote that hilo generators cant work with JTA. I spotted a link here http://www.hibernate.org/Documentation/ ... oGenerator

would this solve this problem? is this the only way to get hilo to work in an app server?


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