|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.spicefactory.pimento.metadata.EntityMetadata
public class EntityMetadata
The metadata for a single persistent entity type.
| Constructor Summary | |
|---|---|
EntityMetadata()
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
addInterceptor(Class<? extends Annotation> interceptorType,
Object interceptor,
MethodInvoker invoker)
Adds an interceptor for this entity type. |
void |
applyUpdate(Object entity,
EntityUpdate update)
Applies the specified update to the given entity. |
Object |
getEntityId(Object entity)
Retrieves the id for the specified entity. |
int |
getId()
Returns the id for this entity metadata. |
PropertyMetadata |
getIdProperty()
Returns the property holding the entity id. |
String |
getLogString(Object entity)
Retrieves log output for the specified entity |
EntityMetadata |
getMetadataById(int id)
Retrieves the metadata for the specified id, if it corresponds to this entity or to a subclass of this entity. |
EntityMetadata |
getMetadataForClass(Class<?> persistentClass)
Retrieves the metadata for the specified persistent class, if its type is a subclass of this entity or the entity class itself. |
Set<Operation> |
getOperations()
Returns the EnityManager operations permitted for the client. |
List<PropertyMetadata> |
getProperties()
Returns all property metadata for this entity. |
PropertyMetadata |
getPropery(String name)
Returns the property metadata for the specified property name. |
EntityMetadata |
getSuperclass()
Returns the metadata for the persistent superclass. |
Class<?> |
getType()
Returns the entity type. |
boolean |
hasOperation(Operation op)
Checks whether the specified EntityManager operation is permitted for the client |
void |
invokeInterceptors(Class<? extends Annotation> type,
Object entity,
Operation operation)
Invokes the interceptors for the specified type and operation. |
void |
invokeInterceptors(Object entity,
EntityEncoder encoder,
Operation operation)
Invokes the load interceptor for the specified operaion. |
void |
invokeInterceptors(Object entity,
EntityUpdate update,
Operation operation)
Invokes the merge interceptor for the specified operaion. |
boolean |
isRefreshable()
Checks whether this entity contains any properties marked as refreshable. |
void |
populateFullSnapshot(Object entity,
FullEntitySnapshot snapshot,
FetchPlan fetchPlan,
IoContext context,
EntityEncoder encoder)
Populates the specified snapshot with property values from the specified entity. |
void |
populateRefreshedSnapshot(Object entity,
PartialEntitySnapshot snapshot,
IoContext context)
Populates the specified snapshot with property values from the specified entity. |
void |
readExternal(DataInput input)
Restores the content of this object from the DataInput instance. |
void |
setSuperclass(EntityMetadata superMetadata)
Sets the metadata for the pesistent superclass of this entity. |
void |
writeExternal(DataOutput output)
Saves the content of this object to the DataOutput instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EntityMetadata()
| Method Detail |
|---|
public int getId()
public Class<?> getType()
public PropertyMetadata getIdProperty()
public List<PropertyMetadata> getProperties()
public PropertyMetadata getPropery(String name)
name - the name of the property
public Set<Operation> getOperations()
public boolean hasOperation(Operation op)
op - the operation to check
public Object getEntityId(Object entity)
entity - the entity to retrieve the id for
public String getLogString(Object entity)
entity - the entity to log
public void populateFullSnapshot(Object entity,
FullEntitySnapshot snapshot,
FetchPlan fetchPlan,
IoContext context,
EntityEncoder encoder)
entity - the entity to extract property values fromsnapshot - the snapshot to populatefetchPlan - the fetch plan to use for the entitycontext - the active IoContextencoder - the encoder instance for the specified entity
public void populateRefreshedSnapshot(Object entity,
PartialEntitySnapshot snapshot,
IoContext context)
@Refreshable.
entity - the entity to extract property values fromsnapshot - the partial snapshot to populatecontext - the active IoContext
public void applyUpdate(Object entity,
EntityUpdate update)
entity - the entity to apply the update forupdate - the update to apply
public void addInterceptor(Class<? extends Annotation> interceptorType,
Object interceptor,
MethodInvoker invoker)
interceptorType - the interceptor typeinterceptor - the interceptor instanceinvoker - the interceptor method
public void invokeInterceptors(Class<? extends Annotation> type,
Object entity,
Operation operation)
type - the interceptor typeentity - the affected entityoperation - the current operation or null if this is not an EntityManager operation
public void invokeInterceptors(Object entity,
EntityUpdate update,
Operation operation)
entity - the affected entityupdate - the currently processed entity updateoperation - the current operation or null if this is not an EntityManager operation
public void invokeInterceptors(Object entity,
EntityEncoder encoder,
Operation operation)
entity - the affected entityencoder - the encoder for the currently processed entityoperation - the current operation or null if this is not an EntityManager operationpublic EntityMetadata getSuperclass()
public void setSuperclass(EntityMetadata superMetadata)
superMetadata - the metadata for the pesistent superclass of this entitypublic EntityMetadata getMetadataForClass(Class<?> persistentClass)
persistentClass - the type to retrieve the metadata for
public EntityMetadata getMetadataById(int id)
id - the metadata id
public boolean isRefreshable()
public void readExternal(DataInput input)
Externalizable
readExternal in interface Externalizableinput - the AMF3 data to read frompublic void writeExternal(DataOutput output)
Externalizable
writeExternal in interface Externalizableoutput - the output to write to
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||