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-class>java.lang.Long</unknown-pk-class>
  |       <field-name>id</field-name>
  |       <column-name>ID</column-name>
  |       <jdbc-type>BIGINT</jdbc-type>
  |       <sql-type>BIGINT</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-class>java.lang.Long</unknown-pk-class>
  |         <field-name>userId</field-name>
  |         <column-name>USER_ID</column-name>
  |       </unknown-pk>
  | 

Jeff Beal

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3829782#3829782

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=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=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to