// license-header java merge-point // // Attention: Generated code! Do not modify by hand! // Generated by EmbeddedValue.vsl in andromda-ejb3-cartridge on 09/18/2014 16:56:11. // package org.andromda.test.howto20.a; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Embeddable; /** *
* TODO: Model Documentation for org.andromda.test.howto20.a.PersonName *
* * Migrated from using @Embeddable annotation to mapping in orm.xml * Still needs the attribute annotations */ @Embeddable public abstract class PersonName implements Serializable { /** * The serial version UID of this class. Needed for serialization. */ private static final long serialVersionUID = 4092849071200240965L; /** * Creates a new instance of {@link PersonName} * taking all properties. * @param firstName * @param surname */ public static PersonName newInstance(String firstName, String surname) { PersonNameImpl object = new PersonNameImpl(); object.setFirstName(firstName); object.setSurname(surname); object.initialize(); return object; } /** * Creates a new instance from other PersonName instance. * @param otherObject * @return PersonName */ public static PersonName newInstance(PersonName otherObject) { if (otherObject != null) { return newInstance(otherObject.getFirstName(),otherObject.getSurname()); } return null; } /** * Constructor does nothing */ protected PersonName() { // Constructor does nothing } /** * Hook for initializing the object in the subclass */ protected void initialize() { // Empty initialization } private String firstName; /** ** TODO: Model Documentation for firstName *
* @return String */ @Column(name = "FIRST_NAME", nullable = false, insertable = true, updatable = true) public String getFirstName() { return this.firstName; } /** ** TODO: Model Documentation for org.andromda.test.howto20.a.PersonName *
* @param firstNameIn */ public void setFirstName(String firstNameIn) { this.firstName = firstNameIn; } private String surname; /** ** TODO: Model Documentation for surname *
* @return String */ @Column(name = "SURNAME", nullable = false, insertable = true, updatable = true) public String getSurname() { return this.surname; } /** ** TODO: Model Documentation for org.andromda.test.howto20.a.PersonName *
* @param surnameIn */ public void setSurname(String surnameIn) { this.surname = surnameIn; } /** * Indicates if the argument is of the same type and all values are equal. */ /** * Indicates if the argument is of the same type and all values are equal. * @param object The target object to compare with * @return boolean True if both objects a 'equal' * @see Object#equals(Object) */ @Override public boolean equals(Object object) { if (null == object) { return false; } if (this == object) { return true; } if (!(object instanceof PersonName)) { return false; } final PersonName that = (PersonName)object; if (this.getFirstName() == null || that.getFirstName() == null || !this.getFirstName().equals(that.getFirstName())) { return false; } if (this.getSurname() == null || that.getSurname() == null || !this.getSurname().equals(that.getSurname())) { return false; } return true; } /** * Returns a hash code value for the object * @return int The hash code value * @see Object#hashCode */ @Override public int hashCode() { int hashCode = 0; hashCode = 29 * hashCode + (getFirstName() == null ? 0 : getFirstName().hashCode()); hashCode = 29 * hashCode + (getSurname() == null ? 0 : getSurname().hashCode()); return hashCode; } /** * Returns a String representation of the object * * @return String Textual representation of the object displaying name/value pairs for all attributes */ /** * Returns a String representation of the object * @return String Textual representation of the object displaying name/value pairs for all attributes * @see Object#toString */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("PersonName("); sb.append(" firstName=").append(getFirstName()); sb.append(" surname=").append(getSurname()); sb.append(")"); return sb.toString(); } }