hai
I am trying to deploy bean managed entity bean example given in ed roman book.chapter 8.
I am using weblogic ver5.1.
in my descriptor i have given primary class as AccountPK
ejdc gives me an error stating that i should implement pulic boolean equals(object o) and public int hashCode()
method .
please tell me ho should I proceed?
uregent.
banking on your help.
vaidya
a copy of error
ERROR: Error from ejbc: [9.2.9] In EJB romanbm, the primary key class must imple
ment the method boolean equals(Object other).
ERROR: Error from ejbc: [9.2.9] In EJB romanbm, the primary key class must imple
ment the method public int hashCode().
ERROR: ejbc found errors
-
urgent bean managed example fo edroman ejbc error (3 messages)
- Posted by: Web Master
- Posted on: December 20 2000 07:37 EST
Threaded Messages (3)
- urgent bean managed example fo edroman ejbc error by amol anvekar on December 20 2000 10:12 EST
- URGENT - ejbc error ... by A JP on January 04 2001 13:26 EST
- URGENT - ejbc error ... by Vel Saran on January 05 2001 08:56 EST
- URGENT - ejbc error ... by A JP on January 04 2001 13:26 EST
-
urgent bean managed example fo edroman ejbc error[ Go to top ]
- Posted by: amol anvekar
- Posted on: December 20 2000 10:12 EST
- in response to Web Master
add the follwing methods to ur pk class. the pk class i presume may have some variable called accountID.
public int hashCode() {
return ((accountID).hashCode());
}
public boolean equals(Object obj){
if(!(obj instanceof AccountPK))
return false;
if( (accountID.equals(((AccountPK)obj).getAccountID())) )
return true;
else
return false;
}
-
URGENT - ejbc error ...[ Go to top ]
- Posted by: A JP
- Posted on: January 04 2001 13:26 EST
- in response to amol anvekar
Hi !
I use weblogic 5.1. I've created jar file manually. But when I try to generate container classes using ejbc, I get the following error:
ERROR: Error from ejbc: [9.2.9] In EJB Test, the primary key class must implement the method public int hachCode()
ERROR: Error from ejbc: [9.2.9] In EJB Test, the primary key class must implement the method boolean equals <Object other>.
ERROR: ejbc found errors.
Then I included the two methods in my Primary class files ()returning 0 and false). But still I get the same errors.
Could any one help me out regarding this problem. It is very urgent. This is my primary key class :
package hitachi.buyplan;
import java.io.Serializable;
public class TestPK implements Serializable
{
public TestPK(){}
public int hashCode()
{
return 0;
}
public boolean equals(Object obj)
{
return false;
}
}
Thanx
AJP -
URGENT - ejbc error ...[ Go to top ]
- Posted by: Vel Saran
- Posted on: January 05 2001 20:56 EST
- in response to A JP
Hi,
Make u'r code as follows:
public class TestPK implements Serializable
{
public TestPK(){}
public int id;
public int hashCode()
{
return id;
}
public boolean equals(Object obj)
{
if(obj instanceof TestPK)
{
return (id == ((TestPK)obj).id);
}
return false;
}
public String toString()
{
return String.valueOf(id);
}
}
Hope now it will work
Regards
Saran