package Sample; public class SampleBeanPrimaryKey implements java.io.Serializable { public Integer code; public SampleBeanPrimaryKey() { } public boolean equals(Object obj) { if (obj == null) return false; if (!(obj instanceof SampleBeanPrimaryKey)) return false; SampleBeanPrimaryKey pk = (SampleBeanPrimaryKey)obj; boolean b = (code == null)?(pk.code == null):code.equals(pk.code); return b; } public int hashCode() { String temp = String.valueOf(code); return temp.hashCode(); } }