RE: using xdoclet to have cmp auto-generate primary key values

"Darren Hartford" <[email protected]>
Newsgroups gmane.comp.java.ejb.middlegen.user
Message-ID <[email protected]>
Hey Mike,
A quick and poor answer for you. Xdoclet/ejbdoclet itself does not offer support for key generation, so you will need to look to an external source for the generation class(es).

If using the Jboss App server, recommend looking at the Jboss docs on key generation.  They have quite the section on how to do this, as well as detailing pros/cons to different methods (I remember they have a newer DB-based-keygen that is pretty fast...).

I think Middlegen does have some of its own built-in key generation classes, but I've never used Middlegen's classes and not sure if there are any examples on how to use theirs.

Another solution, although kind of overkill, is Hibernate also contains some keygen classes you could use.

Hope this helps!
-D


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.