This content has been marked as final.
Show 3 replies
-
1. Re: An error when deploying EJB.. is this a bug.
seven Aug 27, 2001 12:30 PM (in response to praveen)Try to do it like this:
public boolean equals(Object other){
if(other instanceof MyBMPPK){
MyBMPPK otherpk = (MyBMPPK)other;
if(otherpk.MY_ID.equals(this.MY_ID) && otherpk.MY_ID2.equals(this.MY_ID2))
return true;
else return false;
}
return false;
}
In fact u didn't override the equals method 'cause the signature is
public boolean equals(Object other) and u used
public boolean equals(MyBMPPK other) -
2. Re: An error when deploying EJB.. is this a bug.
dciarnie Aug 27, 2001 12:32 PM (in response to praveen)I think your problem is that you've overloaded the equals method, not overridden it.
It should be declared as:public boolean equals(Object other) { if(other instanceof MyBMPPK) return ( this.MY_ID.equals(((MyBMPPK)other).MY_ID) && this.MY_ID2.equals(((MyBMPPK)other).MY_ID2) ); else return false; }
Note the argument to the method.
Hope this helps,
Dan Ciarniello -
3. Re: An error when deploying EJB.. is this a bug.
praveen Aug 27, 2001 1:25 PM (in response to praveen)Thanks for your help, Dan & "Seven".