// license-header java merge-point // // Attention: Generated code! Do not modify by hand! // Generated by: HibernateEntity.vsl in andromda-hibernate-cartridge. // package org.andromda.test.5; /** * */ public abstract class Car implements java.io.Serializable { /** * The serial version UID of this class. Needed for serialization. */ private static final long serialVersionUID = 6539318151456100893L; private java.lang.String serial; /** * */ public java.lang.String getSerial() { return this.serial; } public void setSerial(java.lang.String serial) { this.serial = serial; } private java.lang.String name; /** * */ public java.lang.String getName() { return this.name; } public void setName(java.lang.String name) { this.name = name; } private org.andromda.test.5.CarType type; /** * */ public org.andromda.test.5.CarType getType() { return this.type; } public void setType(org.andromda.test.5.CarType type) { this.type = type; } private java.lang.Long id; /** * */ public java.lang.Long getId() { return this.id; } public void setId(java.lang.Long id) { this.id = id; } private org.andromda.test.5.Person owner; /** * */ public org.andromda.test.5.Person getOwner() { return this.owner; } public void setOwner(org.andromda.test.5.Person owner) { this.owner = owner; } /** *
* Returns true if this car is current rented. *
*/ public abstract boolean isRented(); /** * Returnstrue if the argument is an Car instance and all identifiers for this entity
* equal the identifiers of the argument entity. Returns false otherwise.
*/
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.
*/
public int hashCode()
{
int hashCode = 0;
hashCode = 29 * hashCode + (id == null ? 0 : id.hashCode());
return hashCode;
}
/**
* Constructs new instances of {@link org.andromda.test.5.Car}.
*/
public static final class Factory
{
/**
* Constructs a new instance of {@link org.andromda.test.5.Car}.
*/
public static org.andromda.test.5.Car newInstance()
{
return new org.andromda.test.5.CarImpl();
}
/**
* Constructs a new instance of {@link org.andromda.test.5.Car}, taking all possible properties
* (except the identifier(s))as arguments.
*/
public static org.andromda.test.5.Car newInstance(java.lang.String serial, java.lang.String name, org.andromda.test.5.CarType type, org.andromda.test.5.Person owner)
{
final org.andromda.test.5.Car entity = new org.andromda.test.5.CarImpl();
entity.setSerial(serial);
entity.setName(name);
entity.setType(type);
entity.setOwner(owner);
return entity;
}
}
// HibernateEntity.vsl merge-point
}