Animal.java
// 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.samples.animalquiz.decisiontree;
/**
* <p>
* TODO: Model Documentation for Animal
* </p>
*/
// HibernateEntity.vsl annotations merge-point
public abstract class Animal
extends DecisionItemImpl
{
/**
* The serial version UID of this class. Needed for serialization.
*/
private static final long serialVersionUID = -7646279892397918719L;
// Generate 1 attributes
private String name;
/**
* <p>
* TODO: Model Documentation for name
* </p>
* @return this.name String
*/
public String getName()
{
return this.name;
}
/**
* <p>
* TODO: Model Documentation for name
* </p>
* @param nameIn String
*/
public void setName(String nameIn)
{
this.name = nameIn;
}
// Generate 1 businessOperations
/**
* <p>
* TODO: Model Documentation for getPrompt
* </p>
* @return String
*/
public abstract String getPrompt();
/**
* This entity does not have any identifiers
* but since it extends the <code>DecisionItemImpl</code> class
* it will simply delegate the call up there.
*
* @see DecisionItem#equals(Object)
*/
@Override
public boolean equals(Object object)
{
return super.equals(object);
}
/**
* This entity does not have any identifiers
* but since it extends the <code>DecisionItemImpl</code> class
* it will simply delegate the call up there.
*
* @see DecisionItem#hashCode()
*/
@Override
public int hashCode()
{
return super.hashCode();
}
/**
* Constructs new instances of {@link Animal}.
*/
public static final class Factory
{
/**
* Constructs a new instance of {@link Animal}.
* @return new AnimalImpl()
*/
public static Animal newInstance()
{
return new AnimalImpl();
}
/**
* Constructs a new instance of {@link Animal}, taking all required and/or
* read-only properties as arguments, except for identifiers.
* @param rootItem boolean
* @return newInstance
*/
public static Animal newInstance(boolean rootItem)
{
final Animal entity = new AnimalImpl();
entity.setRootItem(rootItem);
return entity;
}
/**
* Constructs a new instance of {@link Animal}, taking all possible properties
* (except the identifier(s))as arguments.
* @param name String
* @param rootItem boolean
* @param yesSuccessor DecisionItem
* @param noSuccessor DecisionItem
* @return newInstance Animal
*/
public static Animal newInstance(String name, boolean rootItem, DecisionItem yesSuccessor, DecisionItem noSuccessor)
{
final Animal entity = new AnimalImpl();
entity.setName(name);
entity.setRootItem(rootItem);
entity.setYesSuccessor(yesSuccessor);
entity.setNoSuccessor(noSuccessor);
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
*/
public int compareTo(Animal other)
{
int cmp = 0;
if (this.getId() != null)
{
cmp = this.getId().compareTo(other.getId());
}
else
{
if (this.getName() != null)
{
cmp = (cmp != 0 ? cmp : this.getName().compareTo(other.getName()));
}
}
return cmp;
}
// HibernateEntity.vsl merge-point
}