// 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:05. // package org.andromda.test.howto1.g; import java.io.Serializable; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Lob; import javax.persistence.NamedQuery; import javax.persistence.Table; import javax.validation.constraints.NotNull; /** *
* TODO: Model Documentation for org.andromda.test.howto1.g.Car *
* * Autogenerated POJO EJB class for Car containing the * bulk of the entity implementation. * * This is autogenerated by AndroMDA using the EJB3 * cartridge. * * DO NOT MODIFY this class. */ @Entity @Table(name="CAR") @NamedQuery(name="Car.findAll", query="SELECT c FROM Car AS c") public class Car implements Serializable, Comparable* TODO: Model Documentation for serial *
* Get the serial property. * @return String The value of serial */ @Column(name="SERIAL", nullable=false, insertable=true, updatable=true) @NotNull(message="serial is required") 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", nullable=false, insertable=true, updatable=true) @NotNull(message="name is required") 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 String The value of type */ @Lob @Basic(fetch=FetchType.EAGER) @Column(name="TYPE", nullable=false, insertable=true, updatable=true) @NotNull(message="type is required") public String getType() { return this.type; } /** ** TODO: Model Documentation for type *
* Set the type property. * @param value the new value */ public void setType(String value) { this.type = value; } /** ** TODO: Model Documentation for picture *
* Get the picture property. * @return byte[] The value of picture */ @Lob @Column(name="PICTURE", nullable=false, insertable=true, updatable=true) @NotNull(message="picture is required") public byte[] getPicture() { return this.picture; } /** ** TODO: Model Documentation for picture *
* Set the picture property. * @param value the new value */ public void setPicture(byte[] value) { this.picture = value; } /** ** TODO: Model Documentation for information *
* Get the information property. * @return char[] The value of information */ @Lob @Column(name="INFORMATION", nullable=false, insertable=true, updatable=true) @NotNull(message="information is required") public char[] getInformation() { return this.information; } /** ** TODO: Model Documentation for information *
* Set the information property. * @param value the new value */ public void setInformation(char[] value) { this.information = value; } /** ** TODO: Model Documentation for id *
* Get the id property. * @return Long The value of id */ @Id @GeneratedValue(strategy=GenerationType.AUTO) @Column(name="ID", nullable=false, insertable=true, updatable=true) public Long getId() { return this.id; } /** ** TODO: Model Documentation for id *
* Set the id property. * @param value the new value */ public void setId(Long value) { this.id = value; } // ------------- 0 Relations ------------------ // --------------- Constructors ----------------- /** * Default empty no-arg constructor */ public Car() { // Default empty constructor } /** * Constructor with all updatable Entity attributes except auto incremented identifiers. * * @param serial String value for the serial property required=true lower=1 * @param name String value for the name property required=true lower=1 * @param type String value for the type property required=true lower=1 * @param picture byte[] value for the picture property required=true lower=1 * @param information String value for the information property required=true lower=1 */ public Car(String serial, String name, String type, byte[] picture, char[] information) { this.serial = serial; this.name = name; this.type = type; this.picture = picture; this.information = information; } // -------- 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 Car)) { return false; } final Car that = (Car)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 = 0; 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("Car("); sb.append(" serial=").append(getSerial()); sb.append(" name=").append(getName()); sb.append(" type=").append(getType()); sb.append(" picture=").append(getPicture()); sb.append(" information=").append(getInformation()); sb.append(" id=").append(getId()); sb.append(")"); return sb.toString(); } /** * @see Comparable#compareTo */ @Override public int compareTo(Car o) { int cmp = 0; if (this.getId() != null) { cmp = this.getId().compareTo(o.getId()); } else { if (this.getSerial() != null) { cmp = (cmp != 0 ? cmp : this.getSerial().compareTo(o.getSerial())); } if (this.getName() != null) { cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName())); } } return cmp; } }