// license-header java merge-point // // Attention: Generated code! Do not modify by hand! // Generated by EntityEmbeddable.vsl in andromda-ejb3-cartridge on 09/18/2014 16:56:07. // package org.andromda.test.howto9.b; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.MappedSuperclass; /** *
* TODO: Model Documentation for org.andromda.test.howto9.b.Car *
* * Autogenerated POJO EJB mapped super class for Car containing the * bulk of the entity implementation. * * This is a mapped super class and autogenerated by AndroMDA using the EJB3 * cartridge. * * DO NOT MODIFY this class. */ @MappedSuperclass public abstract class CarEmbeddable extends Vehicle implements Serializable{ private static final long serialVersionUID = 48981959400562006L; // ----------- 3 Attribute Definitions ------------ protected String serial; protected String name; protected CarType type; // --------- 1 Relationship Definitions ----------- protected Person owner; // ---- Manageable Display Attributes (Transient) ----- // -------- 3 Attribute Accessors ---------- /** ** TODO: Model Documentation for serial *
* Get the serial property. * @return String The value of serial */ @Column(name="SERIAL", insertable=true, updatable=true) public String getSerial() { return this.serial; } /** ** TODO: Model Documentation for serial *
* Set the serial property. * @param value the new value */ public void setSerial(String value) { this.serial = value; } /** ** TODO: Model Documentation for name *
* Get the name property. * @return String The value of name */ @Column(name="NAME", insertable=true, updatable=true) public String getName() { return this.name; } /** ** TODO: Model Documentation for name *
* Set the name property. * @param value the new value */ public void setName(String value) { this.name = value; } /** ** TODO: Model Documentation for type *
* Get the type property. * @return CarType The value of type */ @Column(name="TYPE", insertable=true, updatable=true, columnDefinition="VARCHAR(20)") @Enumerated(EnumType.STRING) public CarType getType() { return this.type; } /** ** TODO: Model Documentation for type *
* Set the type property. * @param value the new value */ public void setType(CarType value) { this.type = value; } // ------------- 1 Relations ------------------ /** ** TODO: Model Documentation for owner *
* Get the owner * @return Person */ @ManyToOne() @JoinColumn(name="OWNER_FK", insertable=true, updatable=true) public Person getOwner() { return this.owner; } /** ** TODO: Model Documentation for owner *
* Set the owner * @param ownerIn */ public void setOwner(Person ownerIn) { this.owner = ownerIn; } // --------------- Constructors ----------------- /** * Default empty no-arg constructor */ public CarEmbeddable() { // Default empty constructor } /** * Constructor with all updatable Entity attributes except auto incremented identifiers. * * @param make String value for the make property required=true lower=1 * @param model String value for the model property required=true lower=1 * @param age short value for the age property required=true lower=1 * @param serial String value for the serial property required=false lower=1 * @param name String value for the name property required=false lower=1 * @param type CarType value for the type property required=false lower=1 */ public CarEmbeddable(String make, String model, short age, String serial, String name, CarType type) { this.make = make; this.model = model; this.age = age; this.serial = serial; this.name = name; this.type = type; } /** * Constructor with required Entity attributes except auto incremented identifiers. * * @param make Value for the make property * @param model Value for the model property * @param age Value for the age property */ public CarEmbeddable(String make, String model, short age) { this.make = make; this.model = model; this.age = age; } /** * Constructor with all Entity attribute values and CMR relations. * * @param make String value for the make property * @param model String value for the model property * @param age short value for the age property * @param serial String value for the serial property * @param name String value for the name property * @param type CarType value for the type property * @param owner Person value for the owner relation */ public CarEmbeddable(String make, String model, short age, String serial, String name, CarType type, Person owner) { // 6 updatableAttributes setMake(make); setModel(model); setAge(age); setSerial(serial); setName(name); setType(type); // 1 relations setOwner(owner); } // -------- Common Methods ----------- /** * 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 CarEmbeddable)) { return false; } final CarEmbeddable that = (CarEmbeddable)object; if (this.getId() == null || that.getId() == null || !this.getId().equals(that.getId())) { 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 = super.hashCode(); hashCode = 29 * hashCode + (getId() == null ? 0 : getId().hashCode()); return hashCode; } /** * 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("CarEmbeddable("); sb.append(super.toString()); sb.append(" serial=").append(getSerial()); sb.append(" name=").append(getName()); sb.append(" type=").append(getType()); sb.append(" make=").append(getMake()); sb.append(" model=").append(getModel()); sb.append(" age=").append(getAge()); sb.append(" id=").append(getId()); sb.append(" owner=").append(getOwner()); sb.append(")"); return sb.toString(); } }