// 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 Car implements Serializable { /** * The serial version UID of this class. Needed for serialization. */ private static final long serialVersionUID = -3145946244436067157L; // Generate the attributes private java.lang.String serial; /** * * @return this.serial java.lang.String */ public java.lang.String getSerial() { return this.serial; } /** * * @param serialIn java.lang.String */ public void setSerial(java.lang.String serialIn) { this.serial = serialIn; } 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.lang.String type; /** * * @return this.type java.lang.String */ public java.lang.String getType() { return this.type; } /** * * @param typeIn java.lang.String */ public void setType(java.lang.String typeIn) { this.type = typeIn; } 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 org.andromda.test.3.Person owner; /** * * @return this.owner org.andromda.test.3.Person */ public org.andromda.test.3.Person getOwner() { return this.owner; } /** * * @param ownerIn org.andromda.test.3.Person */ public void setOwner(org.andromda.test.3.Person ownerIn) { this.owner = ownerIn; } /** *

* Returns true if this car is current rented. *

* @return boolean */ public abstract boolean isRented(); /** * Returns true if the argument is an Car 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 Car)) { return false; } final Car that = (Car)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.Car}. */ public static final class Factory { /** * Constructs a new instance of {@link org.andromda.test.3.Car}. * @return new org.andromda.test.3.CarImpl() */ public static org.andromda.test.3.Car newInstance() { return new org.andromda.test.3.CarImpl(); } /** * Constructs a new instance of {@link org.andromda.test.3.Car}, taking all possible properties * (except the identifier(s))as arguments. * @param serial java.lang.String * @param name java.lang.String * @param type java.lang.String * @param owner org.andromda.test.3.Person * @return newInstance org.andromda.test.3.Car */ public static org.andromda.test.3.Car newInstance(java.lang.String serial, java.lang.String name, java.lang.String type, org.andromda.test.3.Person owner) { final org.andromda.test.3.Car entity = new org.andromda.test.3.CarImpl(); entity.setSerial(serial); entity.setName(name); entity.setType(type); entity.setOwner(owner); return entity; } } // HibernateEntity.vsl merge-point }