it's better to create a method to generate it in a UtilClass
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?
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.
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.