1 27 28 package dataregistry; 29 30 import java.io.Serializable ; 31 import java.math.BigDecimal ; 32 33 36 public final class LineItemPK implements Serializable { 37 38 public Integer orderId; 39 public BigDecimal itemId; 40 43 public boolean equals(Object otherOb) { 44 45 if (this == otherOb) { 46 return true; 47 } 48 if (!(otherOb instanceof LineItemPK)) { 49 return false; 50 } 51 LineItemPK other = (LineItemPK) otherOb; 52 return ( 53 54 (orderId==null?other.orderId==null:orderId.equals(other.orderId)) 55 && 56 (itemId==null?other.itemId==null:itemId.equals(other.itemId)) 57 58 ); 59 } 60 61 64 public int hashCode() { 65 return ( 66 67 (orderId==null?0:orderId.hashCode()) 68 ^ 69 (itemId==null?0:itemId.hashCode()) 70 71 ); 72 } 73 74 } 75 | Popular Tags |