Hi!

Tim Squires wrote:
> I have the following errors appearing on deployment of an entity EJB with a
> single primary key, the value of the primary key being populated from an
> Oracle sequence:
> 
> [Verifier]
> Class  : area_type
> Section: 9.2.9
> Warning: The primary key class must override equals().

This check instantiates two primary key instances and checks if they are
equal. In your case, since you are generating new id's in the
constructor this fails.

> [Verifier]
> Class  : area_type
> Section: 9.2.9
> Warning: The primary key class must override hashCode().

See above.

>   public area_typePK()
>   {
>     //Connect to the database
>     Connection conn = null;
<snip>

Do NOT generate id's in the constructor of the primary key. The
container will be instantiating primary key objects in a number of
cases, so what you do will really blow things up.

Put it outside in another class, or in a static member of your pk (bad
too, but would at least "work").

/Rickard

-- 
Rickard �berg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to