Here is the XDoclet tags for the bean : | /** | * @ejb.bean | * description="Category" | * local-jndi-name="CategoryLocal" | * jndi-name="Category" | * name="Category" | * primkey-field="categoryId" | * type="CMP" | * cmp-version = "2.x" | * view-type="both" | * | * @ejb.persistence | * table-name = "Category" | * | * @ejb.transaction | * type = "Required" | * | * @ejb.finder | * signature = "java.util.Collection findAllSons(java.lang.Integer categoryId)" | * query = "SELECT OBJECT(obj) | * FROM Category AS c, | * IN (c.sonCategories) AS obj | * WHERE obj.fatherCategory.categoryId = ?1" | * | * @ejb.finder | * signature = "java.util.Collection findAll()" | * query = "SELECT OBJECT(obj) | * FROM Category AS obj" | * | * @jboss.entity-command | * name="mysql-get-generated-keys" | * class="org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCMySQLCreateCommand" | */ | Here is the method of the pk :
| /** | * | * @return | * | * @ejb.pk-field | * | * @ejb.persistence | * column-name = "categoryId" | * jdbc-type = "INTEGER" | * sql-type = "INTEGER" | * | * @jboss.persistence | * not-null = "true" | * auto-increment = "true" | */ | public abstract Integer getCategoryId(); | | public abstract void setCategoryId(Integer categoryId); | When I try to deploy the bean, MySQL complains like this : | ERROR 1064: You have an error in your SQL syntax. Check the manual that corresp | onds to your MySQL server version for the right syntax to use near 'IDENTITY, na | me VARCHAR(15), description VARCHAR(255),father_cat | however, this command creates the table normally : | mysql> CREATE TABLE category(categoryId INTEGER NOT NULL AUTO_INCREMENT, name VA | RCHAR(15), description VARCHAR(255),father_categoryId INTEGER, CONSTRAINT PK_CAT | EGORY PRIMARY KEY (categoryId)); | If anyone can help me ... View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3835790#3835790 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3835790 ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click _______________________________________________ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
