org.qi4j.entitystore.sql.internal
Class SQLEntityState.DefaultSQLEntityState

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

public static final class SQLEntityState.DefaultSQLEntityState
extends java.lang.Object
implements SQLEntityState


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.qi4j.entitystore.sql.internal.SQLEntityState
SQLEntityState.DefaultSQLEntityState
 
Constructor Summary
SQLEntityState.DefaultSQLEntityState(DefaultEntityState state)
           
SQLEntityState.DefaultSQLEntityState(DefaultEntityState state, java.lang.Long entityPK, java.lang.Long entityOptimisticLock)
           
 
Method Summary
 EntityReference associationValueOf(QualifiedName stateName)
           
 EntityDescriptor entityDescriptor()
           
 boolean equals(java.lang.Object obj)
           
 DefaultEntityState getDefaultEntityState()
           
 java.lang.Long getEntityOptimisticLock()
           
 java.lang.Long getEntityPK()
           
 int hashCode()
           
 EntityReference identity()
          Returns the identity of the entity that this EntityState represents.
 boolean isAssignableTo(java.lang.Class<?> type)
           
 long lastModified()
          Last modified timestamp of the entity.
 ManyAssociationState manyAssociationValueOf(QualifiedName stateName)
           
 java.lang.Object propertyValueOf(QualifiedName stateName)
           
 void remove()
          Remove the entity represented by this EntityState when the unit of work is completed.
 void setAssociationValue(QualifiedName stateName, EntityReference newEntity)
           
 void setPropertyValue(QualifiedName stateName, java.lang.Object json)
           
 EntityStatus status()
          The status of this EntityState
 java.lang.String toString()
           
 java.lang.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)

SQLEntityState.DefaultSQLEntityState

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

getEntityPK

public java.lang.Long getEntityPK()
Specified by:
getEntityPK in interface SQLEntityState

getEntityOptimisticLock

public java.lang.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

associationValueOf

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

manyAssociationValueOf

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

propertyValueOf

public java.lang.Object propertyValueOf(QualifiedName stateName)
Specified by:
propertyValueOf 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.

isAssignableTo

public boolean isAssignableTo(java.lang.Class<?> type)
Specified by:
isAssignableTo 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

setAssociationValue

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

setPropertyValue

public void setPropertyValue(QualifiedName stateName,
                             java.lang.Object json)
Specified by:
setPropertyValue 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 java.lang.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(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

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

toString

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