1 package org.apache.ojb.broker; 2 3 import org.apache.ojb.broker.Identity; 4 5 8 public class ArticlePrimaryKey implements java.io.Serializable  9 { 10 11 12 int id; 13 14 17 public ArticlePrimaryKey(int key) 18 { 19 id = key; 21 22 } 23 24 25 30 public boolean equals(Object o) 31 { 32 if (o instanceof ArticlePrimaryKey) 33 return (id == ((ArticlePrimaryKey) o).id); 34 else 35 return false; 36 } 37 38 43 public int hashCode() 44 { 45 return id; 46 } 47 48 51 public ArticlePrimaryKey(Identity oid) 52 { 53 54 id = ((Integer ) oid.getPrimaryKeyValues()[0]).intValue(); 55 56 } 57 } 58 | Popular Tags |