-->
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.  [ 5 posts ] 
Author Message
 Post subject: globally change hibernate_sequence
PostPosted: Thu Jan 05, 2006 11:49 am 
Newbie

Joined: Thu Mar 17, 2005 12:10 am
Posts: 8
I want to use another sequence (let's say my_sequence) instead of hibernate_sequence for all my objects, but I don't want to have explicitly specify my_sequence in each of those objects. Is there a way to change the default sequence (through configuration perhaps) to be my_sequence instead of hibernate_sequence?

Hibernate version:

Hiberate 3.0


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 12:02 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
provide your own id generator implementation that changes the default.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 1:37 pm 
Newbie

Joined: Thu Mar 17, 2005 12:10 am
Posts: 8
max wrote:
provide your own id generator implementation that changes the default.


Doesn't that pose the same problem? Wouldn't I have to associate the generator with each class whose id I want to generate. I'm looking for something I can change in one place (for example, in hibernate.cfg.xml).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 1:52 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You will have to specify that on every class. You can do that programmatically, however, if its really such a big problem - parse the mappings, modify the DOM trees, add to configuration.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2006 3:51 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
today you also specifically add "sequence" to the <generator> ...with a custom type just replace "sequence" with "org.whatever.MySequenceAsIWantIt"

_________________
Max
Don't forget to rate


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