Class EntityContext
java.lang.Object
org.apache.olingo.ext.proxy.context.EntityContext
- All Implemented Interfaces:
Iterable<AttachedEntity>
Entity context.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFurtherDeletes(URI uri) voidattach(EntityInvocationHandler entity) Attaches an existing entity with status ATTACHED.voidattach(EntityInvocationHandler entity, AttachedEntityStatus status) Attaches an entity with specified status.voidattach(EntityInvocationHandler entity, AttachedEntityStatus status, boolean force) Attaches an entity with specified status.voidattachNew(EntityInvocationHandler entity) Attaches an entity with status NEW.voiddetach(EntityInvocationHandler entity) Detaches entity.voidDetaches all attached entities.getEntity(EntityUUID uuid) Searches an entity with the specified key.getStatus(EntityInvocationHandler entity) Gets entity status.booleanisAttached(EntityInvocationHandler entity) Checks if an entity is already attached.iterator()Iterator.voidsetStatus(EntityInvocationHandler entity, AttachedEntityStatus status) Changes attached entity status.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
EntityContext
public EntityContext()
-
-
Method Details
-
attachNew
Attaches an entity with status NEW.
Use this method to attach a new created entity.- Parameters:
entity- entity to be attached.- See Also:
-
attach
Attaches an existing entity with status ATTACHED.
Use this method to attach an existing entity.- Parameters:
entity- entity to be attached.- See Also:
-
attach
Attaches an entity with specified status.
Use this method to attach an existing entity.- Parameters:
entity- entity to be attached.status- status.- See Also:
-
attach
Attaches an entity with specified status.
Use this method to attach an existing entity.- Parameters:
entity- entity to be attached.status- status.force- force attach.
-
detach
Detaches entity.- Parameters:
entity- entity to be detached.
-
detachAll
public void detachAll()Detaches all attached entities.
Use this method to clears the entity context. -
getEntity
Searches an entity with the specified key.- Parameters:
uuid- entity key.- Returns:
- retrieved entity.
-
getStatus
Gets entity status.- Parameters:
entity- entity to be retrieved.- Returns:
- attached entity status.
-
setStatus
Changes attached entity status.- Parameters:
entity- attached entity to be modified.status- new status.
-
isAttached
Checks if an entity is already attached.- Parameters:
entity- entity.- Returns:
- true if is attached; false otherwise.
-
iterator
Iterator.- Specified by:
iteratorin interfaceIterable<AttachedEntity>- Returns:
- attached entities iterator.
-
getFurtherDeletes
-
addFurtherDeletes
-