1 Reply Latest reply on Mar 15, 2005 11:21 AM by hariv

    ValueObject, Serializable, EnitiryBean

    dtn70437

      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 want to transfer the PK out of the container - because the
      class java.lang.object (my PK) is not serializable, i got
      always Exceptions.

      Question: How can i get my PK outside the container and still using auto-increment for the PK ??

      Hope, someody can help me - i scanned the newsgroups but i
      found no answer for this.

      Thanks for helping

      Danny



        • 1. Re: ValueObject, Serializable, EnitiryBean
          hariv

          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?