net.sourceforge.domian.entity
Class AbstractEntity

java.lang.Object
  extended by net.sourceforge.domian.entity.AbstractEntity
All Implemented Interfaces:
Entity
Direct Known Subclasses:
AbstractRandomIntegerEntity, AbstractRandomLongEntity, AbstractUUIDEntity

public abstract class AbstractEntity
extends java.lang.Object
implements Entity

Abstract class for all entity objects, ensuring consistent/unchanging equals/hashCode methods, not influenced by mutable state.

Since:
0.4
Author:
Eirik Torske

Field Summary
protected  java.lang.Integer version
          For possible use of RDBMS optimistic locking.
 
Constructor Summary
AbstractEntity()
           
 
Method Summary
protected  void doWarnLog(java.lang.String message)
           
 boolean equals(java.lang.Object otherObject)
           
 java.lang.Integer getVersion()
           
 int hashCode()
           
 java.lang.Boolean isEntity()
           
 java.lang.Boolean isValueObject()
           
 void setVersion(java.lang.Integer version)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.domian.entity.Entity
getEntityId
 

Field Detail

version

protected java.lang.Integer version
For possible use of RDBMS optimistic locking.

Constructor Detail

AbstractEntity

public AbstractEntity()
Method Detail

getVersion

public java.lang.Integer getVersion()

setVersion

public void setVersion(java.lang.Integer version)

isEntity

public final java.lang.Boolean isEntity()

isValueObject

public final java.lang.Boolean isValueObject()

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public final boolean equals(java.lang.Object otherObject)
Overrides:
equals in class java.lang.Object

doWarnLog

protected void doWarnLog(java.lang.String message)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2006-2009. All Rights Reserved.