1 18 19 package cowsultants.itracker.ejb.client.models; 20 21 import java.util.Date ; 22 import java.io.Serializable ; 23 24 public class GenericModel implements Serializable , Cloneable { 25 protected Integer id = null; 26 protected Date lastModifiedDate; 27 protected Date createDate; 28 29 public GenericModel() { 30 } 31 32 public GenericModel(Integer id) { 33 this.id = id; 34 } 35 36 public Integer getId() { 37 return id; 38 } 39 40 public void setId(Integer value) { 41 id = value; 42 } 43 44 public Date getCreateDate() { 45 return createDate; 46 } 47 48 public void setCreateDate(Date value) { 49 createDate = value; 50 } 51 52 public Date getLastModifiedDate() { 53 return lastModifiedDate; 54 } 55 56 public void setLastModifiedDate(Date value) { 57 lastModifiedDate = value; 58 } 59 60 public Object clone() throws CloneNotSupportedException { 61 return super.clone(); 62 } 63 64 public boolean equals(Object value) { 65 if(value != null && value instanceof GenericModel) { 66 GenericModel mo = (GenericModel) value; 67 if(mo.getId() != null && mo.getId().equals(this.getId())) { 68 return true; 69 } 70 } 71 return false; 72 } 73 74 public int hashCode() { 75 return (this.getId() == null ? super.hashCode() : this.getId().intValue()); 76 } 77 } 78 | Popular Tags |