0 Replies Latest reply on Mar 29, 2002 1:29 AM by Vivian Xia

    Why can't I user UserPK class in CMP entitybean?

    Vivian Xia Newbie

      I have created a UserPK in the CMP. When deploying, Jboss always ask me to override equals() method. Actually, I do override equals(), code and ejb-jar.xml as follows:

      public int hashCode() {
      return this.id;
      }

      public boolean equals(Object o) {
      if (o instanceof UserPK) {
      return true;
      } else {
      return false;
      }
      }

      <ejb-name>com.ejb.user.UserHome</ejb-name>
      com.ejb.user.UserHome
      com.ejb.user.User
      <ejb-class>com.ejb.user.UserBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>com.ejb.user.UserPK</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>UserBean</abstract-schema-name>
      <cmp-field> <field-name>featureFlag</field-name> </cmp-field>
      <cmp-field> <field-name>password</field-name> </cmp-field>
      <cmp-field> <field-name>customerID</field-name> </cmp-field>
      <cmp-field> <field-name>customerName</field-name> </cmp-field>
      <cmp-field> <field-name>passwordAdm</field-name> </cmp-field>
      <cmp-field> <field-name>allowedEditUpdRate</field-name> </cmp-field>
      <cmp-field> <field-name>id</field-name> </cmp-field>
      <cmp-field> <field-name>username</field-name> </cmp-field>

      Why?