org.openwms.core.domain
Class AbstractEntity

java.lang.Object
  extended by org.openwms.core.domain.AbstractEntity
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AbstractPreference, Email, I18n, Location, LocationGroup, LocationType, Message, Module, SecurityObject, TransportOrder, TransportUnit, TransportUnitType, TypePlacingRule, TypeStackingRule, UnitError, User, UserPassword

public abstract class AbstractEntity
extends Object
implements Serializable

An AbstractEntity, used as a base class for all domain classes.

Adds an unique identified to a subclassed domain class that is created when the class is instantiated on the client tier. At least this uid is created before the instance is persisted the first time. The uid may not be mistaken with the id property that is usually used for database identity (primary key) or with a business key column.

This class has an inner static declared class that is registered as a JPA EntityListener and forces the creation of an uid if not already created before. This assures that each persisted entity has an uid.

The uid property is used by the ActionScript client application to synchronize client-side entity instances with server-side ones.

NOTE:
This class uses the uid for comparison with equals(Object) and calculation of hashCode().

Since:
0.1
Version:
$Revision: 1583 $
Author:
Tina Russell
See Also:
Serialized Form

Nested Class Summary
static class AbstractEntity.AbstractEntityListener
          An AbstractEntityListener forces the creation of an uid before the entity is persisted.
 
Field Summary
static String FIND_ALL
          Suffix for the FIND_ALL named query.
static String FIND_BY_ID
          Suffix for the FIND_BY_ID named query.
 
Constructor Summary
AbstractEntity()
           
 
Method Summary
 boolean equals(Object o)
           Compare the uid property field.
 int hashCode()
           Use the uid to calculate the hashCode.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIND_ALL

public static final String FIND_ALL
Suffix for the FIND_ALL named query. Default ".findAll"

See Also:
Constant Field Values

FIND_BY_ID

public static final String FIND_BY_ID
Suffix for the FIND_BY_ID named query. Default ".findById"

See Also:
Constant Field Values
Constructor Detail

AbstractEntity

public AbstractEntity()
Method Detail

equals

public boolean equals(Object o)
Compare the uid property field.

Overrides:
equals in class Object
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Use the uid to calculate the hashCode.

Overrides:
hashCode in class Object
See Also:
String.hashCode()


Copyright © 2005-2011 openwms.org. All Rights Reserved.