You have to configure this in the jbosscmp-jdbc.xml file. In my file, I have the
following code in the defaults section:
unknown-pk
| unknown-pk-classjava.lang.Long/unknown-pk-class
| field-nameid/field-name
| column-nameID/column-name
| jdbc-typeBIGINT/jdbc-type
| sql-typeBIGINT/sql-type
| auto-increment/
| /unknown-pk
| entity-command name=mysql-get-generated-keys/
The unknown-pk section sets up the default values that JBoss will use when it
encounters an unknown primary key. The entity-command section tells JBoss how to get
the information on the key generated by the database.
Of course, for most entities sticking to a column named 'ID' isn't very cool, so in
each entity where I use an unknown primary key, I can add an entity-specific
unknown-pk element to configure the column name for that entity:
unknown-pk
| unknown-pk-classjava.lang.Long/unknown-pk-class
| field-nameuserId/field-name
| column-nameUSER_ID/column-name
| /unknown-pk
|
Jeff Beal
View the original post :
http://www.jboss.org/index.html?module=bbop=viewtopicp=3829782#3829782
Reply to the post :
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3829782
---
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_id=1470alloc_id=3638op=click
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user