-->
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.  [ 1 post ] 
Author Message
 Post subject: GenericGenerator - sequence name question
PostPosted: Wed Mar 20, 2013 3:26 pm 
Newbie

Joined: Thu Oct 14, 2004 12:30 pm
Posts: 3
Hi -

I searched the forums and didn't find this exact issue - apologies in advance if this has been covered before.

I'm using @GenericGenerator, specifically extending SequenceGenerator. This works really well for one class, no problems. My generate method only calls the super.generate method (and actually calls the db sequence) if there is not an id set in the Object passed in. When all the annotations are at the class level, I'm passing in a parameter to set the db sequence name for the entity.

What I'm stuck on is extending this to be able to use this for all of my entities in a general way. I've declared it at the package level, but what I am stuck on is that I'd like to use a different db sequence name for each class. So far, I don't see a way to change the sequence name when the generate method gets called. It may be something simple that I'm not seeing, not sure. I know the configure method can be overridden, but I don't see how that helps in this case where I need the sequence name to be different for each entity (and different each time the generate method is called).

I hope I've explained my issue clearly. Thanks for any thoughts on this.

_________________
Mike Dalsey


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.