Hi,

        But it seems only an example on single field primary key, not on composite
primary key.

Albert

-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Neelu Mehta
Sent: Tuesday, August 01, 2000 7:49 PM
To: [EMAIL PROTECTED]
Subject: Re: Composite primary key


i think it can help you out

package crm.Check;

public class CheckBeanPK implements java.io.Serializable {
  public int id;
  public CheckBeanPK(int id){
  this.id = id;
  }

  public CheckBeanPK(){}

  public String toString() {
  Integer n = new Integer(id);
  return n.toString();
  }
  public int hashCode() {
  return id;
  }

  public boolean equals (Object other) {
  return (((CheckBeanPK) other).id == this.id);
  }


Neelu
-----Original Message-----
From:   Albert [SMTP:[EMAIL PROTECTED]]
Sent:   Tuesday, August 01, 2000 1:17 PM
To:     [EMAIL PROTECTED]
Subject:        Re: Composite primary key

Hi,

        How to write the hashcode and equal part of the primary key class??

Albert

-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Saji Peter Mathew
Sent: Tuesday, August 01, 2000 3:15 PM
To: [EMAIL PROTECTED]
Subject: Re: Composite primary key


since the ebj1.0 specs needs you to have a primary key class, u can
implement this in the primary class and this call file can be added in the
XML descriptor. This way u can add any no. of composite keys..
-Saji
-----Original Message-----
From: Albert Chow [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 30, 2000 9:51 PM
To: [EMAIL PROTECTED]
Subject: Composite primary key


Hi,

        If my database table has a composite primary key (e.g. column A +
column
B), how do I specify it in my EJB and XML file??  Thanx in advance..

Albert

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

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

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

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

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