Alvaro Mota wrote:

> Hi
>
> "The EJBHome server requires a container-managed entity Bean to have a
> primary key class with a public primary key field (or fields, if using
> composite primary keys). You can have the container manage an enterprise
> Bean or write the code to manage the Bean yourself. In this example, both
> Beans are container-managed, and you should always let the container manage
> an entity Bean.
> Here is the primary key class. The primary key in the Bonus table is socsec,
> and so socsec is a public field in this class that is assigned a value when
> the class is constructed.
>
> package com.ejbhome.examples;
>
> public class BonusPK implements java.io.Serializable {
>   public int socsec;
>
>   public BonusPK(int socsec) {
>     this.socsec = socsec;
>   }
>
>   public BonusPK() {}
> }"
>
> when primary key have fields, is necessary implementation the methods :
> equals(), hashCode() and toString()?
>
> if necessary how make??
>
> thank very much
>
> �lvaro Mota Goncalves
> [...]

Hi :-)  you can find the discussion about "equals()",  "hashCode()",
"= =", "clone()" in the following:

- Joshua Bloch   "Effective Java Programming Language Guide"(ISBN 0-201-31005-8)

- http://www.macchiato.com/


Bo
July 12, 2001

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to