The Artima Developer Community
Sponsored Link

Java Answers Forum
EJB3 My own SequenceGenerator

2 replies on 1 page. Most recent reply: Sep 14, 2009 1:50 AM by Kondwani Mkandawire

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

EJB3 My own SequenceGenerator Posted: Aug 13, 2009 4:15 AM
Reply to this message Reply
Advertisement
I notice @SequenceGenerator from EJB3 deals with involves ints/longs as indicated by initialValue parameter.

I need to achieve a SequenceGenerator involving: "00001", "00002", "00003" - Strings. I assume I have to create a customized SequenceGenerator? With Initial value "00000".

Would @GeneratedValue achieve this? Perhaps I can extend the Interface SequenceGenerator - but then I would need an implementation? How would that implementation injected?

Any advise would be appreciated.


Thomas SMETS

Posts: 307
Nickname: tsmets
Registered: Apr, 2002

Re: EJB3 My own SequenceGenerator Posted: Sep 10, 2009 9:02 AM
Reply to this message Reply
ID should be 1, 2, 3, ... this means NUMBERS
Display of the ID could be "00001", "00002", "00003" ... or "one", "two", "three"....
Writting your own stuff to go around bad implementation design is not correct !
Request people to do their home work, even when painfull

\T,

Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: EJB3 My own SequenceGenerator Posted: Sep 14, 2009 1:50 AM
Reply to this message Reply
> ID should be 1, 2, 3, ... this means NUMBERS
> Display of the ID could be "00001", "00002", "00003" ...
> or "one", "two", "three"....
> Writting your own stuff to go around bad implementation
> design is not correct !
> Request people to do their home work, even when painfull
>
> \T,

Not quite sure where the Homework comment comes from but thanks for the 1, 2, 3 suggestion hadn't thought of that :o)

Flat View: This topic has 2 replies on 1 page
Topic: difference between an attribute and a property Previous Topic   Next Topic Topic: Delete/edit/add to a text file or recreate?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use