Hi all,
I am trying to implement a CMP bean that has a auto-increment primary key.
The xdoclets that I am using are :
At class level:
/**
* @ejb.bean name="test"
* jndi-name="testBean"
* type="CMP"
* primkey-field="id"
* schema="test"
* cmp-version="2.x"
*
* @ejb.persistence
* table-name="TEST_TABLE"
*
* @ejb.finder
* query="SELECT OBJECT(a) FROM test as a"
* signature="java.util.Collection findAll()"
*
* @jboss.entity-command name="postgresql-fetch-seq"
* class="org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCPostgreSQLCreateCommand"
**/
And at method level:
/**
* Returns the id
* @return the id
*
* @ejb.persistent-field
* @ejb.persistence
* column-name="id"
* sql-type="INT"
* @ejb.pk-field
* @ejb.interface-method
*
* @jboss.column-name name="id"
* @jboss.persistence
* auto-increment="true"
* not-null="true"
*
*/
public abstract java.lang.Integer getId();
But at run time when I am try to create the ejb i get the following error:
javax.ejb.CreateException: Could not create entity:org.postgresql.util.PSQLException:
ERROR: null value in column "id" violates not-null constraint
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.performInsert(JDBCAbstractCreateCommand.java:303)
I am using JBOSS 3.2.3 and Postgres 7.4.2
Does anyone had similar problems ??
Thanks in advance
George
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3833737#3833737
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3833737
-------------------------------------------------------
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