Alex Cachia wrote:
>
> Does this look like a valid Entity EJB Primary Key for EJB 1.1  Each time I try
> to create an entity with a key like this I get a NullPointerException.

Have you tried examing your stack trace to see exactly what
is throwing the exception (client or server, for example).

> If anyone has a valid (it's worked before) Entity EJB Primary Key for EJB 1.1
> I'd appreciate the example code.
>
> Regard,
>
> Alex
> --------- begin code ---------
>
> import java.io.Serializable;
>
> public class PrimaryKey implements Serializable {
>
>   public String uid = null;
>   public String cid = null;
>
>   public PrimaryKey(String uk, String ck) {
>     uid = new String(uk);
>     cid = new String(ck);
>   }
>
>   public String toString() {
>     return uid.toString();
>   }
>
>   public int hashCode() {
>     return uid.hashCode();
>   }
>
>   public boolean equals(Object other) {
>     return uid.equals(other);

Try:
      PrimaryKey that = (PrimaryKey)object;
      return this.uid = that.uid && this.cid = that.cid;

>   }
> }
>
> --------- end code ---------
>
> __________________________________________________
> Do You Yahoo!?
> Send instant messages & get email alerts with Yahoo! Messenger.
> http://im.yahoo.com/
>
> ===========================================================================
> 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".

--
________________________________________________________________________________

Evan Ireland              Sybase EAServer Engineering        [EMAIL PROTECTED]
                            Wellington, New Zealand               +64 4 934-5856

===========================================================================
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