|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.spicefactory.pimento.io.IoContext
public class IoContext
The I/O context for a single service invocation. This class is responsible for converting snapshots to entities and vice versa and keeping track of already processed entities.
| Constructor Summary | |
|---|---|
IoContext(PimentoConfig config,
EntityManager em,
Operation operation)
Creates a new instance. |
|
| Method Summary | |
|---|---|
Object |
getEntity(EntitySnapshot snapshot,
EntityMetadata metadata)
Assemble the specified snapshot to a persistent entity. |
Object |
getEntityForProxy(ProxyEntitySnapshot proxy,
EntityMetadata metadata)
Retrieves a reference for the specified proxy snapshot. |
Class<?> |
getPersistentClass(Object entity)
Returns the persistent class for the specified entity. |
PimentoConfig |
getPimentoConfig()
Returns the Pimento configuration for this context instance. |
EntitySnapshot |
getSnapshot(Object entity,
EntityMetadata metadata,
FetchPlan fetchPlan)
Disassemble the specified entity to a snapshot representation. |
EntitySnapshot |
getSnapshot(Object entity,
EntityMetadata metadata,
FetchPlan fetchPlan,
boolean lazy)
Disassemble the specified entity to a snapshot representation. |
boolean |
isUnitializedProxy(Object entity)
Checks whether the specified entity is an uninitialized proxy. |
void |
prefetchUpdatedEntities(List<ApplicableEntitySnapshot> updatedEntities)
Prefetches all updated entities from the database and applies all changes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IoContext(PimentoConfig config,
EntityManager em,
Operation operation)
config - the Pimento configurationem - the EntityManageroperation - the current operation| Method Detail |
|---|
public PimentoConfig getPimentoConfig()
public void prefetchUpdatedEntities(List<ApplicableEntitySnapshot> updatedEntities)
updatedEntities - list of snapshots that contain the updates to process
public Object getEntityForProxy(ProxyEntitySnapshot proxy,
EntityMetadata metadata)
proxy - the proxy snapshot to retrieve a reference formetadata - the metadata for the entity
public Object getEntity(EntitySnapshot snapshot,
EntityMetadata metadata)
snapshot - the snapshot to processmetadata - the metadata for the entity
public EntitySnapshot getSnapshot(Object entity,
EntityMetadata metadata,
FetchPlan fetchPlan)
entity - the entity to disassemblemetadata - the metadata for the entityfetchPlan - the fetch plan to use
public EntitySnapshot getSnapshot(Object entity,
EntityMetadata metadata,
FetchPlan fetchPlan,
boolean lazy)
entity - the entity to disassemblemetadata - the metadata for the entityfetchPlan - the fetch plan to uselazy - whether the entity should be lazily fetched
public boolean isUnitializedProxy(Object entity)
entity - the entity to check
public Class<?> getPersistentClass(Object entity)
entity - the entity to return the persistent class for
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||