HandoutDoc.java
// license-header java merge-point
//
// Attention: Generated code! Do not modify by hand!
// Generated by hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge on 08/18/2014 15:29:45-0400.
//
package org.andromda.samples.carrental.contracts;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* Document that is filled when the rental company hands out a car to a driver.
* </p>
*/
// HibernateEntity.vsl annotations merge-point
public abstract class HandoutDoc
implements Serializable, Comparable<HandoutDoc>
{
/**
* The serial version UID of this class. Needed for serialization.
*/
private static final long serialVersionUID = -3852041228711815353L;
// Generate 3 attributes
private Date handoutDate;
/**
* <p>
* TODO: Model Documentation for handoutDate
* </p>
* @return this.handoutDate Date
*/
public Date getHandoutDate()
{
return this.handoutDate;
}
/**
* <p>
* TODO: Model Documentation for handoutDate
* </p>
* @param handoutDateIn Date
*/
public void setHandoutDate(Date handoutDateIn)
{
this.handoutDate = handoutDateIn;
}
private Date returnDate;
/**
* <p>
* TODO: Model Documentation for returnDate
* </p>
* @return this.returnDate Date
*/
public Date getReturnDate()
{
return this.returnDate;
}
/**
* <p>
* TODO: Model Documentation for returnDate
* </p>
* @param returnDateIn Date
*/
public void setReturnDate(Date returnDateIn)
{
this.returnDate = returnDateIn;
}
private Long id;
/**
* <p>
* TODO: Model Documentation for id
* </p>
* @return this.id Long
*/
public Long getId()
{
return this.id;
}
/**
* <p>
* TODO: Model Documentation for id
* </p>
* @param idIn Long
*/
public void setId(Long idIn)
{
this.id = idIn;
}
// Generate 1 associations
private Contract contract;
/**
* <p>
* TODO: Model Documentation for contract
* </p>
* @return this.contract Contract
*/
public Contract getContract()
{
return this.contract;
}
/**
* <p>
* TODO: Model Documentation for contract
* </p>
* @param contractIn Contract
*/
public void setContract(Contract contractIn)
{
this.contract = contractIn;
}
/**
* Returns <code>true</code> if the argument is an HandoutDoc instance and all identifiers for this entity
* equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
*/
@Override
public boolean equals(Object object)
{
if (this == object)
{
return true;
}
if (!(object instanceof HandoutDoc))
{
return false;
}
final HandoutDoc that = (HandoutDoc)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 HandoutDoc}.
*/
public static final class Factory
{
/**
* Constructs a new instance of {@link HandoutDoc}.
* @return new HandoutDocImpl()
*/
public static HandoutDoc newInstance()
{
return new HandoutDocImpl();
}
/**
* Constructs a new instance of {@link HandoutDoc}, taking all possible properties
* (except the identifier(s))as arguments.
* @param handoutDate Date
* @param returnDate Date
* @param contract Contract
* @return newInstance HandoutDoc
*/
public static HandoutDoc newInstance(Date handoutDate, Date returnDate, Contract contract)
{
final HandoutDoc entity = new HandoutDocImpl();
entity.setHandoutDate(handoutDate);
entity.setReturnDate(returnDate);
entity.setContract(contract);
return entity;
}
}
/**
* @param other
* @return a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
* @see Comparable#compareTo
*/
@Override
public int compareTo(HandoutDoc other)
{
int cmp = 0;
if (this.getId() != null)
{
cmp = this.getId().compareTo(other.getId());
}
else
{
if (this.getHandoutDate() != null)
{
cmp = (cmp != 0 ? cmp : this.getHandoutDate().compareTo(other.getHandoutDate()));
}
if (this.getReturnDate() != null)
{
cmp = (cmp != 0 ? cmp : this.getReturnDate().compareTo(other.getReturnDate()));
}
}
return cmp;
}
// HibernateEntity.vsl merge-point
}