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.
* @jboss.jdbc-type "INTEGER"
* @jboss.sql-type "INTEGER(11)"
* @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.
Hi Scott !
It seems like XDoclet is generating a wrong deployment descriptor for JBoss-3.0.x (have a look at the DTD). I think that the auto-increment feature is only available in JBoss 3.2 and above (with the autonumber plugin and unknown primary keys).