1 28 29 package com.caucho.ejb.entity; 30 31 34 public class EntityKey { 35 private EntityServer _server; 36 private Object _primaryKey; 37 38 public EntityKey() 39 { 40 } 41 42 public EntityKey(EntityServer server, Object key) 43 { 44 _server = server; 45 _primaryKey = key; 46 } 47 48 public void init(EntityServer server, Object key) 49 { 50 _server = server; 51 _primaryKey = key; 52 } 53 54 57 public int hashCode() 58 { 59 return 65521 * System.identityHashCode(_server) + _primaryKey.hashCode(); 60 } 61 62 65 public boolean equals(Object o) 66 { 67 if (this == o) 68 return true; 69 70 if (o == null || getClass() != o.getClass()) 71 return false; 72 73 EntityKey key = (EntityKey) o; 74 75 return _server == key._server && _primaryKey.equals(key._primaryKey); 76 } 77 78 public String toString() 79 { 80 return "EntityKey[]"; 81 } 82 } 83 | Popular Tags |