1 8 9 package com.sleepycat.persist.model; 10 11 import java.io.Serializable ; 12 import java.util.Map ; 13 14 23 public class EntityMetadata implements Serializable { 24 25 private static final long serialVersionUID = 4224509631681963159L; 26 27 private String className; 28 private PrimaryKeyMetadata primaryKey; 29 private Map <String ,SecondaryKeyMetadata> secondaryKeys; 30 31 34 public EntityMetadata(String className, 35 PrimaryKeyMetadata primaryKey, 36 Map <String ,SecondaryKeyMetadata> secondaryKeys) { 37 this.className = className; 38 this.primaryKey = primaryKey; 39 this.secondaryKeys = secondaryKeys; 40 } 41 42 45 public String getClassName() { 46 return className; 47 } 48 49 54 public PrimaryKeyMetadata getPrimaryKey() { 55 return primaryKey; 56 } 57 58 65 public Map <String ,SecondaryKeyMetadata> getSecondaryKeys() { 66 return secondaryKeys; 67 } 68 69 @Override 70 public boolean equals(Object other) { 71 if (other instanceof EntityMetadata) { 72 EntityMetadata o = (EntityMetadata) other; 73 return ClassMetadata.nullOrEqual(className, o.className) && 74 ClassMetadata.nullOrEqual(primaryKey, o.primaryKey) && 75 ClassMetadata.nullOrEqual(secondaryKeys, o.secondaryKeys); 76 } else { 77 return false; 78 } 79 } 80 81 @Override 82 public int hashCode() { 83 return ClassMetadata.hashCode(className) + 84 ClassMetadata.hashCode(primaryKey) + 85 ClassMetadata.hashCode(secondaryKeys); 86 } 87 } 88 | Popular Tags |