// license-header java merge-point // // Attention: Generated code! Do not modify by hand! // Generated by: HibernateEntity.vsl in andromda-hibernate-cartridge. // package org.andromda.test.2; /** * */ public abstract class Person implements java.io.Serializable { /** * The serial version UID of this class. Needed for serialization. */ private static final long serialVersionUID = 2077335445406713868L; private java.lang.String name; /** * */ public java.lang.String getName() { return this.name; } public void setName(java.lang.String name) { this.name = name; } private java.util.Date birthDate; /** * */ public java.util.Date getBirthDate() { return this.birthDate; } public void setBirthDate(java.util.Date birthDate) { this.birthDate = birthDate; } private java.lang.Long id; /** * */ public java.lang.Long getId() { return this.id; } public void setId(java.lang.Long id) { this.id = id; } private java.util.Collection cars = new java.util.HashSet(); /** * */ public java.util.Collection getCars() { return this.cars; } public void setCars(java.util.Collection cars) { this.cars = cars; } /** * Returns true if the argument is an Person instance and all identifiers for this entity * equal the identifiers of the argument entity. Returns false otherwise. */ public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof Person)) { return false; } final Person that = (Person)object; if (this.id == null || that.getId() == null || !this.id.equals(that.getId())) { return false; } return true; } /** * Returns a hash code based on this entity's identifiers. */ public int hashCode() { int hashCode = 0; hashCode = 29 * hashCode + (id == null ? 0 : id.hashCode()); return hashCode; } /** * Constructs new instances of {@link org.andromda.test.2.Person}. */ public static final class Factory { /** * Constructs a new instance of {@link org.andromda.test.2.Person}. */ public static org.andromda.test.2.Person newInstance() { return new org.andromda.test.2.PersonImpl(); } /** * Constructs a new instance of {@link org.andromda.test.2.Person}, taking all required and/or * read-only properties as arguments. */ public static org.andromda.test.2.Person newInstance(java.lang.String name, java.util.Date birthDate) { final org.andromda.test.2.Person entity = new org.andromda.test.2.PersonImpl(); entity.setName(name); entity.setBirthDate(birthDate); return entity; } /** * Constructs a new instance of {@link org.andromda.test.2.Person}, taking all possible properties * (except the identifier(s))as arguments. */ public static org.andromda.test.2.Person newInstance(java.lang.String name, java.util.Date birthDate, java.util.Collection cars) { final org.andromda.test.2.Person entity = new org.andromda.test.2.PersonImpl(); entity.setName(name); entity.setBirthDate(birthDate); entity.setCars(cars); return entity; } } // HibernateEntity.vsl merge-point }