Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » SequenceGenerator(SequenceGenerator with a prefix)
SequenceGenerator [message #656791] Mon, 28 February 2011 10:40 Go to next message
No real name is currently offline No real name
Messages: 4
Registered: November 2010
Junior Member
Hi,

I am using oracle database. All my tables uses sequence generator. One of my table customer has a sequence generator but needs a prefix for the primary key. If the sequence generated is 01 , I would like it to be saved as C01. I know in hibernate there is a prefix. Is there anything like that where I can add a prefix for the ID.

Any help is really appreciated.

Thanks.
Re: SequenceGenerator [message #657100 is a reply to message #656791] Tue, 01 March 2011 10:34 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

You may be able to use a Converter or a custom Sequence object to implement this.

You could also generate the id in your application, or through the prePersist event.


James : Wiki : Book : Blog : Twitter
Previous Topic:Is there any deadlock bug fix for TopLink Essential?
Next Topic:SessionCustomizer in OSGi environments
Goto Forum:
  


Current Time: Thu Apr 17 11:40:40 EDT 2014

Powered by FUDForum. Page generated in 0.02361 seconds