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 TypeMethodDescriptionvoid
addFurtherDeletes
(URI uri) void
attach
(EntityInvocationHandler entity) Attaches an existing entity with status ATTACHED.void
attach
(EntityInvocationHandler entity, AttachedEntityStatus status) Attaches an entity with specified status.void
attach
(EntityInvocationHandler entity, AttachedEntityStatus status, boolean force) Attaches an entity with specified status.void
attachNew
(EntityInvocationHandler entity) Attaches an entity with status NEW.void
detach
(EntityInvocationHandler entity) Detaches entity.void
Detaches all attached entities.getEntity
(EntityUUID uuid) Searches an entity with the specified key.getStatus
(EntityInvocationHandler entity) Gets entity status.boolean
isAttached
(EntityInvocationHandler entity) Checks if an entity is already attached.iterator()
Iterator.void
setStatus
(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, wait
Methods 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:
iterator
in interfaceIterable<AttachedEntity>
- Returns:
- attached entities iterator.
-
getFurtherDeletes
-
addFurtherDeletes
-