1 Reply Latest reply on Mar 27, 2003 1:54 AM by jcordes

    Can't get auto-incrementing with MySQL and XDoclet to work

    sczadzeck

      I'd like to use the auto-incrementing capabilities of MySQL using JBoss CMP and XDoclet but so far have been unsuccessful in getting it to work. Here's the current incantation of code where I'm attempting to configure this capability:

      /**
      * Unique identifier of the build request.
      *
      * @ejb.pk-field
      * @jboss.persistence
      * auto-increment="true"
      * @jboss.jdbc-type "INTEGER"
      * @jboss.sql-type "INTEGER(11)"
      * @ejb.interface-method
      * @ejb.persistence column-name="Item_Id"
      */
      public abstract Integer getItemId();

      When I deploy this I receive the following error:

      09:06:23,421 ERROR [XmlFileLoader] File file:/C:/Program Files/JBoss/server/default/tmp/deploy/server/default/deploy/nemesis.jar/29.nemesis.jar!/META-INF/jbosscmp-jdbc.xml process error. Line: 57. Error message: org.xml.sax.SAXParseException: Element "cmp-field" allows no further input; "auto-increment" is not allowed.

      I'm using all the current versions of MySQL (4.0.12), JBoss (3.0.6), and MySQL-ConnectorJ (3.0.6). Any help will be GREATLY appreciated.

      Thanks,
      Scott