2 Replies Latest reply on Oct 3, 2003 9:18 AM by Prabhakar Krishnaswami

    A CMR question

    Prabhakar Krishnaswami Newbie

      I have an entity bean whose deployment descriptor is as below:


      <display-name>PhoneBean</display-name>
      <ejb-name>PhoneBean</ejb-name>
      <local-home>PhoneLocalHome</local-home>
      PhoneLocal
      <ejb-class>PhoneBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Object</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>Phone</abstract-schema-name>
      <cmp-field>
      extension
      <field-name>extension</field-name>
      </cmp-field>
      <cmp-field>
      countrycode
      <field-name>countrycode</field-name>
      </cmp-field>
      <cmp-field>
      type
      <field-name>type</field-name>
      </cmp-field>
      <cmp-field>
      areacode
      <field-name>areacode</field-name>
      </cmp-field>
      <cmp-field>
      number
      <field-name>number</field-name>
      </cmp-field>
      <ejb-local-ref>
      <ejb-ref-name>ejb/local/Person</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>PersonLocalHome</local-home>
      PersonLocal
      <ejb-link>listener.jar#PersonBean</ejb-link>
      </ejb-local-ref>
      <security-identity>

      <use-caller-identity></use-caller-identity>
      </security-identity>


      The above bean does not have a <primkey-field> element. Is there a way to prevent JBoss from creating a primary key column in jbosscmp-jdbc.xml?

        • 1. Re: A CMR question
          vincentchun Newbie

          "The above bean does not have a <primkey-field> element. Is there a way to prevent JBoss from creating a primary key column in jbosscmp-jdbc.xml?"

          No

          JBoss needs PK and all entity bean must have "findByPrimaryKey" method. If you miss it, you cannot deploy your .jar / .ear successfully.

          • 2. Re: A CMR question
            Prabhakar Krishnaswami Newbie

            You have brought up an interesting point ie every entitybean should have a <primkey-field> element. The snippet of the ejb-jar file I had displayed in my initial post was part of enterprise techtips that Sun had in their web site. I have attached a ejb-jar.xml from Sun's techtips for August 2003. Look at the address and phone bean. They don't have <primkey-field>. You are right I was able to successfully deploy and execute the application in the techtip for July2003 only by modifying the ejb-jar.xml and the bean's home interface.