net.sourceforge.domian.entity
Class AbstractRandomLongEntity

java.lang.Object
  extended by net.sourceforge.domian.entity.AbstractEntity
      extended by net.sourceforge.domian.entity.AbstractRandomLongEntity
All Implemented Interfaces:
Entity

public abstract class AbstractRandomLongEntity
extends AbstractEntity

Abstract class for entity objects, ensuring a final, unique, non-null entity ID from the moment they are created.

The entity ID provided by this class is just a random Long. This class is suitable for test entities with the need for simple, readable entity IDs. If the application is kind of important, and the number of entities in the application is somewhat large, do not use this class in production environments.

Since:
0.4.1
Author:
Eirik Torske

Field Summary
protected  java.lang.Long entityId
           
 
Fields inherited from class net.sourceforge.domian.entity.AbstractEntity
timeOfCreation, version
 
Constructor Summary
AbstractRandomLongEntity()
           
 
Method Summary
 java.lang.Long getEntityId()
          An entity object should at all time have a final, unique, non-null entity ID.
 
Methods inherited from class net.sourceforge.domian.entity.AbstractEntity
doWarnLog, equals, getTimeOfCreation, getVersion, hashCode, isEntity, isValueObject, setVersion, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

entityId

protected final java.lang.Long entityId
Constructor Detail

AbstractRandomLongEntity

public AbstractRandomLongEntity()
Method Detail

getEntityId

public final java.lang.Long getEntityId()
Description copied from interface: Entity
An entity object should at all time have a final, unique, non-null entity ID.

Returns:
the entity ID


Copyright © 2006-2010. All Rights Reserved.