Class EntityContext

java.lang.Object
org.apache.olingo.ext.proxy.context.EntityContext
All Implemented Interfaces:
Iterable<AttachedEntity>

public class EntityContext extends Object implements Iterable<AttachedEntity>
Entity context.
  • Constructor Details

    • EntityContext

      public EntityContext()
  • Method Details

    • attachNew

      public void attachNew(EntityInvocationHandler entity)
      Attaches an entity with status NEW.
      Use this method to attach a new created entity.
      Parameters:
      entity - entity to be attached.
      See Also:
    • attach

      public void attach(EntityInvocationHandler entity)
      Attaches an existing entity with status ATTACHED.
      Use this method to attach an existing entity.
      Parameters:
      entity - entity to be attached.
      See Also:
    • attach

      public void attach(EntityInvocationHandler entity, AttachedEntityStatus status)
      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

      public void attach(EntityInvocationHandler entity, AttachedEntityStatus status, boolean force)
      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

      public void detach(EntityInvocationHandler entity)
      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

      public EntityInvocationHandler getEntity(EntityUUID uuid)
      Searches an entity with the specified key.
      Parameters:
      uuid - entity key.
      Returns:
      retrieved entity.
    • getStatus

      public AttachedEntityStatus getStatus(EntityInvocationHandler entity)
      Gets entity status.
      Parameters:
      entity - entity to be retrieved.
      Returns:
      attached entity status.
    • setStatus

      public void setStatus(EntityInvocationHandler entity, AttachedEntityStatus status)
      Changes attached entity status.
      Parameters:
      entity - attached entity to be modified.
      status - new status.
    • isAttached

      public boolean isAttached(EntityInvocationHandler entity)
      Checks if an entity is already attached.
      Parameters:
      entity - entity.
      Returns:
      true if is attached; false otherwise.
    • iterator

      public Iterator<AttachedEntity> iterator()
      Iterator.
      Specified by:
      iterator in interface Iterable<AttachedEntity>
      Returns:
      attached entities iterator.
    • getFurtherDeletes

      public List<URI> getFurtherDeletes()
    • addFurtherDeletes

      public void addFurtherDeletes(URI uri)