Nope. It is on the todo.
build a entitybean with fields:
to serves as a counter ...
or do this (may cause problems when machine switch datetime setting):
public class IdGenerator
private static long t = System.currentTimeMillis();
public static long getNextId()
I would highly recommend NOT using this technique.
There are several ways to do PK generation for CMP beans. There are several patterns posted at theserverside.com for PK generation. Look at http://www.theserverside.com/resources/patterns_review.jsp for a pattern. Floyd Marinescu lists several different ways to accomplish PK generation.
If your Entity bean utilises Bean Managed Persistence, you can use the mySQL proprietary method "getLastInsertID()".
I don't know about mySQL 4.0, but in version 3.23 this method only exists in the "Statement" class, so you need to do some casting to make it work, furthermore you must ensure that you use the getUnderlyingPreparedStatement() to get the statement on which you are going to call getLastInsertID().
Meanwhile, if you have figured out something smarter, please let us know, I for one would be very interested.
thanks for advice, if jboss doesn't provide pk generation than i'll be using a variation of the sequence pattern described in theserverside,