This content has been marked as final.
Show 4 replies
-
1. Re: CMP entity bean and primary key
wello007 Aug 25, 2003 6:23 AM (in response to urswag)it's better to create a method to generate it in a UtilClass
-
2. Re: CMP entity bean and primary key
urswag Aug 25, 2003 12:43 PM (in response to urswag)OK, but how.
In SQL I would use select max(primarykey) from t.
In QL I do not find a max function.
Is there somewhere a good description?
Thanks
Urs -
3. Re: CMP entity bean and primary key
maciek Aug 30, 2003 12:34 PM (in response to urswag)Hi
You might want to have a look at the SequenceBlock pattern for generating pk's. It is explained e.g. in Floyd Marinescu "EJB Design Patterns".
It is about a separate bean(actually two beans: session bean + cmp) responsible only for generating pk's for all other cmp's.
regards
maciek zywno -
4. Re: CMP entity bean and primary key
urswag Sep 4, 2003 9:05 AM (in response to urswag)Thank You.
This is good advice. I did it in another way. I used select max(keyid) query to get last used keyid. I have to think about.
In the new release 3.2.x there is an autoincrement tag, but I haven't tried it out.
You can mix JDBC with CMP, it works.
Urs