org.qi4j.library.sql.api
Class SQLEntityState.DefaultSQLEntityState

java.lang.Object
  extended by org.qi4j.library.sql.api.SQLEntityState.DefaultSQLEntityState
All Implemented Interfaces:
SQLEntityState, EntityState
Enclosing interface:
SQLEntityState

public static final class SQLEntityState.DefaultSQLEntityState
extends Object
implements SQLEntityState


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.qi4j.library.sql.api.SQLEntityState
SQLEntityState.DefaultSQLEntityState
 
Constructor Summary
SQLEntityState.DefaultSQLEntityState(DefaultEntityState state, Long entityPK, Long entityOptimisticLock)
           
 
Method Summary
 EntityDescriptor entityDescriptor()
           
 boolean equals(Object obj)
           
 EntityReference getAssociation(QualifiedName stateName)
           
 DefaultEntityState getDefaultEntityState()
           
 Long getEntityOptimisticLock()
           
 Long getEntityPK()
           
 ManyAssociationState getManyAssociation(QualifiedName stateName)
           
 Object getProperty(QualifiedName stateName)
           
 int hashCode()
           
 EntityReference identity()
          Returns the identity of the entity that this EntityState represents.
 boolean isOfType(TypeName type)
           
 long lastModified()
          Last modified timestamp of the entity.
 void remove()
          Remove the entity represented by this EntityState when the unit of work is completed.
 void setAssociation(QualifiedName stateName, EntityReference newEntity)
           
 void setProperty(QualifiedName stateName, Object json)
           
 EntityStatus status()
          The status of this EntityState
 String toString()
           
 String version()
          Version of the entity.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLEntityState.DefaultSQLEntityState

public SQLEntityState.DefaultSQLEntityState(DefaultEntityState state,
                                            Long entityPK,
                                            Long entityOptimisticLock)
Method Detail

getEntityPK

public Long getEntityPK()
Specified by:
getEntityPK in interface SQLEntityState

getEntityOptimisticLock

public Long getEntityOptimisticLock()
Specified by:
getEntityOptimisticLock in interface SQLEntityState

getDefaultEntityState

public DefaultEntityState getDefaultEntityState()
Specified by:
getDefaultEntityState in interface SQLEntityState

entityDescriptor

public EntityDescriptor entityDescriptor()
Specified by:
entityDescriptor in interface EntityState

getAssociation

public EntityReference getAssociation(QualifiedName stateName)
Specified by:
getAssociation in interface EntityState

getManyAssociation

public ManyAssociationState getManyAssociation(QualifiedName stateName)
Specified by:
getManyAssociation in interface EntityState

getProperty

public Object getProperty(QualifiedName stateName)
Specified by:
getProperty in interface EntityState

identity

public EntityReference identity()
Description copied from interface: EntityState
Returns the identity of the entity that this EntityState represents.

Specified by:
identity in interface EntityState
Returns:
the identity of the entity that this EntityState represents.

isOfType

public boolean isOfType(TypeName type)
Specified by:
isOfType in interface EntityState

lastModified

public long lastModified()
Description copied from interface: EntityState
Last modified timestamp of the entity. This is managed by the EntityStore.

If the underlying EntityStore does not support timestamping, then last modified must always be set to the current time.

Specified by:
lastModified in interface EntityState
Returns:
last modified timestamp of the entity, as defined by System.currentTimeMillis()

remove

public void remove()
Description copied from interface: EntityState
Remove the entity represented by this EntityState when the unit of work is completed.

Specified by:
remove in interface EntityState

setAssociation

public void setAssociation(QualifiedName stateName,
                           EntityReference newEntity)
Specified by:
setAssociation in interface EntityState

setProperty

public void setProperty(QualifiedName stateName,
                        Object json)
Specified by:
setProperty in interface EntityState

status

public EntityStatus status()
Description copied from interface: EntityState
The status of this EntityState

Specified by:
status in interface EntityState
Returns:
the status

version

public String version()
Description copied from interface: EntityState
Version of the entity. This is managed by the EntityStore.

If the underlying EntityStore does not support versioning, then version must always be set to 0.

Specified by:
version in interface EntityState
Returns:
version of the entity

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object