hi rickard,
this is the full source code of PersonPK:
i have implemented equals and hashCode
package brj.ejb.test;
public class PersonPK implements java.io.Serializable
{
public long id;
/**
* Default constructor
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
public PersonPK() {
super();
}
/**
* Initialize a key from the passed values
* @param argId long
*/
public PersonPK(long argId) {
id = argId;
}
/**
* equals method
* @return boolean
* @param o java.lang.Object
*/
public boolean equals(java.lang.Object o)
{
if (o instanceof PersonPK)
{
PersonPK otherKey = (PersonPK) o;
return (id == otherKey.id);
}
else
return false;
}
/**
* hashCode method
* @return int
*/
public int hashCode()
{
return new Long(id).hashCode();
}
}
jakob
>From: Rickard �berg <[EMAIL PROTECTED]>
>Reply-To: "jBoss" <[EMAIL PROTECTED]>
>To: jBoss <[EMAIL PROTECTED]>
>Subject: Re: [jBoss-User] CMP deployment Section: 9.4.7.1
>Date: Fri, 08 Dec 2000 13:16:07 +0100
>
>Hi!
>
>Jakob Braeuchi wrote:
> > public class PersonPK implements java.io.Serializable
> > {
> > public long id;
> > }
>
>Note that this is not a valid primary key class. equals() and hashCode()
>methods are missing.
>
> > when deploying the bean i get the following warning:
> >
> > [Verifier]
> > Bean : Person
> > Section: 9.4.7.1
> > Warning: The type of the field named in the primkey-field element must
>match
> > the class in the prim-key-class element.
>
>Remove the "primkey-field" element from your ejb-jar.xml file. See EJB
>specification for details on why.
>
>/Rickard
>
>--
>Rickard �berg
>
>Email: [EMAIL PROTECTED]
>
>
>--
>--------------------------------------------------------------
>To subscribe: [EMAIL PROTECTED]
>To unsubscribe: [EMAIL PROTECTED]
>Problems?: [EMAIL PROTECTED]
>
_____________________________________________________________________________________
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]