Hi,
im using the auto-increment function in an entity bean for the primary key.
On https://www.coredevelopers.net/library/jboss/cmp/keys.jsp i was told to use java.lang.object as the class for the PK. Here is my xdoclet code:
/** * @ejb.bean name="Kunde" display-name="Name for KundeBean" * description="Description for KundeBean" jndi-name="ejb/Kunde" * type="CMP" cmp-version="2.x" view-type="local" * * @ejb.value-object match = "*" name = "Kunde" * * @ejb.util generate = "false" * * @jboss.persistence table-name = "KUNDE" read-only = "false" create-table = * "false" remove-table = "false" * * @jboss.entity-command name="postgresql-fetch-seq" * class="org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCPostgreSQLCreateCommand" * * @jboss.unknown-pk auto-increment = "true" column-name = "KUNDE_ID" jdbc-type = * "INTEGER" sql-type = "INTEGER" class = "java.lang.Integer" * * @ejb.pk class = "java.lang.Object" generate = "false" * * */
I am not sure why you are not using java.lang.Integer as the class for the Primary Key. java.lang.Integer is definetly serializable. I will appreciate if you can explain to me the advantage of using java.lang.Object as the class for the Primary Key?