on 11-06-2007 10:00 AM
Hello SDN!
I have several tables in Java Dictionary. Every table have a field called "id" (type string (32)) witch must be an auto-generated PK.
I can't find in bean settings how I can define these PK's as auto-generated. How I can do it?
It doesn't necessary for me to use number sequences like 1,2,3...
I'm usingCMP beans.
Regards,
Lev
Hello Lev,
you need to set the ID explicitly, there are no such implicit settings for EJB. I've seen some additional java components for to solve this issue, but none of them is pure Java and in most cases it is Database vendor dependent. So the easiest way is to implement your own incrementing routine, or some routine to generate unique IDs, not accending only.
For some inspiration how to do an GUID routine please see this link:
/message/2648947#2648947 [original link is broken]
regards,
mz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.