Skip to main content

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 15:40 Go to next message
No real name is currently offline No real nameFriend
Messages: 4
Registered: November 2010
Junior Member

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.

Re: SequenceGenerator [message #657100 is a reply to message #656791] Tue, 01 March 2011 15:34 Go to previous message
James Sutherland is currently offline James SutherlandFriend
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: Sat Apr 04 09:58:09 GMT 2020

Powered by FUDForum. Page generated in 0.01265 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top