package cylikon.YahooEnt; import java.io.Serializable; public class CategoryPK implements Serializable { public String cat_no; // our primary key, a reference to a category number in the database // sites in the db with common content have common cat numbers public CategoryPK() {} public CategoryPK(String catNo) { cat_no=catNo; } // the three methods below come from EJBHome extending rmi.Remote / which in turn // is implemented by rmi.RemoteObject, so these three methods come from the // RemoteObject class public boolean equals(Object obj) { if (obj==null || !(obj instanceof CategoryPK)) { return false; } else if (((CategoryPK)obj).cat_no==cat_no) { return true; } else { return false; } } public int hashCode() { return Integer.valueOf(cat_no).intValue(); } public String toString() { return cat_no; } } //end Primary Key class