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
|