1 25 26 package org.objectweb.jonas.jtests.beans.relation.s3pkcomp; 27 28 31 public class Pk implements java.io.Serializable 32 { 33 34 public Integer id; 35 36 37 public Pk() { 38 } 39 40 public Pk(int i) 41 { 42 this(new Integer (i)); 43 } 44 45 public Pk(Integer i) { 46 this.id = i; 47 } 48 49 public boolean equals(Object other) 50 { 51 if (other == null) { 52 return false; 53 } 54 if (other == this) { 55 return true; 56 } 57 if (!(other instanceof Pk)) { 58 return false; 59 } 60 Pk otherPk = (Pk)other; 61 return (id.equals(otherPk.id)); 62 } 63 64 public int hashCode() { 65 return id.hashCode(); 66 } 67 68 public String toString() { 69 return("("+id+")"); 70 } 71 } 72 | Popular Tags |