com.sybase.persistence
Class EntityClass

java.lang.Object
  extended by com.sybase.persistence.EntityClass

public class EntityClass
extends java.lang.Object

An utility to invoke Entity methods


Field Summary
protected  EntityMetaData __md
           
protected  ReflectionManager __rm
           
 
Constructor Summary
EntityClass()
          Creates a instance of EntityClass
 
Method Summary
 void cancelPending(java.lang.Object entity)
          Calls the entity's cancelPending method
 void cancelPendingOperations()
          Calls the entity class' cancelPendingOperations method
 void create(java.lang.Object entity)
          Calls the entity's create method
 void delete(java.lang.Object entity)
          Calls the entity's delete method
 ObjectList findWithQuery(Query query)
          Calls the entity's findWithQuery method
 EntityClass finishInit()
          Sybase internal use only.
static EntityClass getInstance(EntityMetaData md, ReflectionManager rm)
          Creates an instance of EntityClass using given Entity MetaData and Object Manager
 EntityMetaData getMd()
          Gets entity metadata
 ReflectionManager getRm()
          Sets object manager
 java.lang.Object getValue(java.lang.Object entity, AttributeMetaData attribute)
          Gets a value of the attribute of the Entity
 java.lang.Object invoke(java.lang.Object entity, OperationMetaData operation, ObjectList parameters)
          Invokes the operation of the entity using given parameters
 boolean isCreated(java.lang.Object entity)
          Returns true if the entity has been created in database.
 boolean isDeleted(java.lang.Object entity)
          Returns true if the entity has been marked as deleted locally.
 boolean isDirty(java.lang.Object entity)
          Returns true if the entity is updated in memory.
 boolean isNew(java.lang.Object entity)
          Returns true if the entity is created in memory.
 boolean isPending(java.lang.Object entity)
          Returns true if the entity has pending operations.
 boolean isUpdated(java.lang.Object entity)
          Returns true if the entity has been updated in database.
 java.lang.Object newObject()
          Creates an instance of the Entity
 void refresh(java.lang.Object entity)
          Calls the entity's refresh method
 void save(java.lang.Object entity)
          Calls the entity's save method
 void setMd(EntityMetaData _md)
          Sets entity metadata
 void setRm(ReflectionManager _rm)
          Creates an instance of EntityClass using given Entity MetaData and Object Manager
 void setValue(java.lang.Object entity, AttributeMetaData attribute, java.lang.Object value)
          Sets a value of the attribute of the Entity
 void submitPending(java.lang.Object entity)
          Calls the entity's submitPending method
 void submitPendingOperations()
          Calls the entity class' submitPendingOperations method
 void update(java.lang.Object entity)
          Calls the entity's update method
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__md

protected EntityMetaData __md

__rm

protected ReflectionManager __rm
Constructor Detail

EntityClass

public EntityClass()
Creates a instance of EntityClass

Method Detail

getMd

public EntityMetaData getMd()
Gets entity metadata


setMd

public void setMd(EntityMetaData _md)
Sets entity metadata


getRm

public ReflectionManager getRm()
Sets object manager


setRm

public void setRm(ReflectionManager _rm)
Creates an instance of EntityClass using given Entity MetaData and Object Manager

Parameters:
md - The entity meta data.
rm - The object manager.

getInstance

public static EntityClass getInstance(EntityMetaData md,
                                      ReflectionManager rm)
Creates an instance of EntityClass using given Entity MetaData and Object Manager

Parameters:
md - The entity meta data.
rm - The object manager.

newObject

public java.lang.Object newObject()
Creates an instance of the Entity


getValue

public java.lang.Object getValue(java.lang.Object entity,
                                 AttributeMetaData attribute)
Gets a value of the attribute of the Entity

Parameters:
attribute - The attribute meta data

setValue

public void setValue(java.lang.Object entity,
                     AttributeMetaData attribute,
                     java.lang.Object value)
Sets a value of the attribute of the Entity

Parameters:
attribute - The attribute meta data
value - The value to be set

invoke

public java.lang.Object invoke(java.lang.Object entity,
                               OperationMetaData operation,
                               ObjectList parameters)
Invokes the operation of the entity using given parameters

Parameters:
entity - The entity
operation - The operation meta data
parameters - The parameters to be used when invoke the operation

isNew

public boolean isNew(java.lang.Object entity)
Returns true if the entity is created in memory. Not saved to database yet.

Parameters:
entity - The entity to check

isDirty

public boolean isDirty(java.lang.Object entity)
Returns true if the entity is updated in memory. Not saved to database yet.

Parameters:
entity - The entity to check

isPending

public boolean isPending(java.lang.Object entity)
Returns true if the entity has pending operations.

Parameters:
entity - The entity to check

isCreated

public boolean isCreated(java.lang.Object entity)
Returns true if the entity has been created in database.

Parameters:
entity - The entity to check

isUpdated

public boolean isUpdated(java.lang.Object entity)
Returns true if the entity has been updated in database.

Parameters:
entity - The entity to check

isDeleted

public boolean isDeleted(java.lang.Object entity)
Returns true if the entity has been marked as deleted locally.

Parameters:
entity - The entity to check

findWithQuery

public ObjectList findWithQuery(Query query)
Calls the entity's findWithQuery method

Parameters:
query - The Query object

save

public void save(java.lang.Object entity)
Calls the entity's save method

Parameters:
entity - The entity object

create

public void create(java.lang.Object entity)
Calls the entity's create method

Parameters:
entity - The entity object

update

public void update(java.lang.Object entity)
Calls the entity's update method

Parameters:
entity - The entity object

delete

public void delete(java.lang.Object entity)
Calls the entity's delete method

Parameters:
entity - The entity object

refresh

public void refresh(java.lang.Object entity)
Calls the entity's refresh method

Parameters:
entity - The entity object

cancelPending

public void cancelPending(java.lang.Object entity)
Calls the entity's cancelPending method

Parameters:
entity - The entity object

submitPending

public void submitPending(java.lang.Object entity)
Calls the entity's submitPending method

Parameters:
entity - The entity object

cancelPendingOperations

public void cancelPendingOperations()
Calls the entity class' cancelPendingOperations method


submitPendingOperations

public void submitPendingOperations()
Calls the entity class' submitPendingOperations method


finishInit

public EntityClass finishInit()
Sybase internal use only.