// license-header java merge-point // // Attention: Generated code! Do not modify by hand! // Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge. // package org.andromda.test.3; import java.io.Serializable; /** * */ public abstract class Person implements Serializable { /** * The serial version UID of this class. Needed for serialization. */ private static final long serialVersionUID = 2077335445406713868L; // Generate the attributes private java.lang.String name; /** * * @return this.name java.lang.String */ public java.lang.String getName() { return this.name; } /** * * @param nameIn java.lang.String */ public void setName(java.lang.String nameIn) { this.name = nameIn; } private java.util.Date birthDate; /** * * @return this.birthDate java.util.Date */ public java.util.Date getBirthDate() { return this.birthDate; } /** * * @param birthDateIn java.util.Date */ public void setBirthDate(java.util.Date birthDateIn) { this.birthDate = birthDateIn; } private java.lang.Long id; /** * * @return this.id java.lang.Long */ public java.lang.Long getId() { return this.id; } /** * * @param idIn java.lang.Long */ public void setId(java.lang.Long idIn) { this.id = idIn; } // Generate the associations private java.util.Collection cars = new java.util.HashSet(); /** * * @return this.cars java.util.Collection */ public java.util.Collection getCars() { return this.cars; } /** * * @param carsIn java.util.Collection */ public void setCars(java.util.Collection carsIn) { this.cars = carsIn; } /** * * @param elementToAdd org.andromda.test.3.Car * @return true if this collection changed as a result of the * call */ public boolean addCars(org.andromda.test.3.Car elementToAdd) { return this.cars.add(elementToAdd); } /** * * @param elementToRemove org.andromda.test.3.Car * @return true if this collection changed as a result of the * call */ public boolean removeCars(org.andromda.test.3.Car elementToRemove) { return this.cars.remove(elementToRemove); } /** * 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. */ @Override 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. */ @Override public int hashCode() { int hashCode = 0; hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode()); return hashCode; } /** * Constructs new instances of {@link org.andromda.test.3.Person}. */ public static final class Factory { /** * Constructs a new instance of {@link org.andromda.test.3.Person}. * @return new org.andromda.test.3.PersonImpl() */ public static org.andromda.test.3.Person newInstance() { return new org.andromda.test.3.PersonImpl(); } /** * Constructs a new instance of {@link org.andromda.test.3.Person}, taking all required and/or * read-only properties as arguments, except for identifiers. * @param name java.lang.String * @param birthDate java.util.Date * @return newInstance */ public static org.andromda.test.3.Person newInstance(java.lang.String name, java.util.Date birthDate) { final org.andromda.test.3.Person entity = new org.andromda.test.3.PersonImpl(); entity.setName(name); entity.setBirthDate(birthDate); return entity; } /** * Constructs a new instance of {@link org.andromda.test.3.Person}, taking all possible properties * (except the identifier(s))as arguments. * @param name java.lang.String * @param birthDate java.util.Date * @param cars java.util.Collection * @return newInstance org.andromda.test.3.Person */ public static org.andromda.test.3.Person newInstance(java.lang.String name, java.util.Date birthDate, java.util.Collection cars) { final org.andromda.test.3.Person entity = new org.andromda.test.3.PersonImpl(); entity.setName(name); entity.setBirthDate(birthDate); entity.setCars(cars); return entity; } } // HibernateEntity.vsl merge-point }