Hi,

I'm getting warnings from the JBoss verifier that I need to override
equals()
and hashCode() in my primary key class.  The problem is, I *am* overriding
these methods.

At the risk of world-wide embarrassment, here's the log and code snippets:

[Verifier] 
Bean   : Item
Section: 9.2.9
Warning: The primary key class must override equals().

[Verifier] 
Bean   : Item
Section: 9.2.9
Warning: The primary key class must override hashCode().


/**
 * Class that provides a Global Unique ID (GUID)
 * for primary keys in the database.
 */
public class GUID implements Serializable {
 .
 .
 .

  /**
   * Test for equality.
   */
  public boolean equals(Object obj) {
    GUID compareTo = (GUID)obj;

    if (_guid.toString().equals(compareTo.toString())) {
      return(true);
    }

    return(false);
  }

  /**
   * Hash code method.
   */
  public int hashCode() {
    return(super.hashCode());
  }
.
.
.
}

The method signatures are correct, right?  What
am I missing?

Thanx.

Norton

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to