This content has been marked as final.
Show 4 replies
-
1. Re: How to use all available ID as primary key?
xiaopang Mar 16, 2008 7:09 AM (in response to mnrz)how about using sequence and set the sequence as cycle
-
2. Re: How to use all available ID as primary key?
mnrz Mar 16, 2008 7:26 AM (in response to mnrz)"xiaopang" wrote:
how about using sequence and set the sequence as cycle
would you please explain more? how to set it as cycle. is this working on all databases or only specific DBs?
anyway thanks a lot -
3. Re: How to use all available ID as primary key?
xiaopang Mar 17, 2008 1:02 AM (in response to mnrz)create a sequence in the databse like this
create sequense seq
minvalue 100000
maxvalue 999999
start with 100000
increment by 1
nocache
cycle
then set entity bean like this
@Id
@GeneratedValuesstratege=GenerationType.SEQUENCE)
if you want more information about you can look up in the EJB3.0 help ducument .you can download it from www.sun.com.or write to me xiaopang106@126.com
you could hava a try but i am not sure it will work
by the way ,how long hava you learn EJB3.0 -
4. Re: How to use all available ID as primary key?
mnrz Mar 17, 2008 4:59 AM (in response to mnrz)Thanks Xiaopang,
I will try it
It's near 4 months since I've started EJB3