1 Reply Latest reply on Feb 23, 2005 11:50 AM by Joshua Davis

    pk-field not generated

    Sven Mackensen Newbie

      Hi,

      I have an EntityBean (CMP) Customer with the following declaration

      /**
      * @ejb.bean name="Customer"
      * display-name="CustomerBean"
      * description="Description for Customer"
      * jndi-name="ejb/Customer"
      * type="CMP"
      * cmp-version="2.x"
      * view-type="remote"
      *
      * @ejb.pk class="java.lang.Integer"
      */


      and a method

      /**
      * Getter for CMP Field ID
      *
      * @ejb.pk-field
      * @ejb.persistent-field
      * @ejb.interface-method view-type="remote"
      */
      public abstract Integer getID();


      When I run XDoclet the generated ejb-jar file is fine except that the <primkey-field> is missing. Can someone point me out what I am doing wrong?

      Thx,
      Sven

        • 1. Re: pk-field not generated
          Joshua Davis Newbie

          I have found that adding the :
          @jboss.relation related-pk-field="relatedID" fk-column="foreignkeyColumnID"


          to the method like this:

          /**
          * Getter for CMP Field ID
          *
          * @ejb.pk-field
          * @ejb.persistent-field
          * @ejb.interface-method view-type="remote"
          * @jboss.relation related-pk-field="relatedID" fk-column="foreignkeyColumnID"
          */
          public abstract Integer getID();