Class DbEntityManager

java.lang.Object
org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager
All Implemented Interfaces:
EntityLoadListener, Session

public class DbEntityManager extends Object implements Session, EntityLoadListener
Author:
Daniel Meyer
  • Field Details

  • Constructor Details

  • Method Details

    • initializeOperationManager

      protected void initializeOperationManager()
    • initializeEntityCache

      protected void initializeEntityCache()
    • selectList

      public List selectList(String statement)
    • selectList

      public List selectList(String statement, Object parameter)
    • selectList

      public List selectList(String statement, Object parameter, Page page)
    • selectList

      public List selectList(String statement, ListQueryParameterObject parameter, Page page)
    • selectList

      public List selectList(String statement, Object parameter, int firstResult, int maxResults)
    • selectList

      public List selectList(String statement, ListQueryParameterObject parameter)
    • selectListWithRawParameter

      public List selectListWithRawParameter(String statement, Object parameter, int firstResult, int maxResults)
    • selectOne

      public Object selectOne(String statement, Object parameter)
    • selectBoolean

      public boolean selectBoolean(String statement, Object parameter)
    • selectById

      public <T extends DbEntity> T selectById(Class<T> entityClass, String id)
    • getCachedEntity

      public <T extends DbEntity> T getCachedEntity(Class<T> type, String id)
    • getCachedEntitiesByType

      public <T extends DbEntity> List<T> getCachedEntitiesByType(Class<T> type)
    • filterLoadedObjects

      protected List filterLoadedObjects(List<Object> loadedObjects)
    • cacheFilter

      protected DbEntity cacheFilter(DbEntity persistentObject)
      returns the object in the cache. if this object was loaded before, then the original object is returned.
    • onEntityLoaded

      public void onEntityLoaded(DbEntity entity)
      Specified by:
      onEntityLoaded in interface EntityLoadListener
    • lock

      public void lock(String statement)
    • lock

      public void lock(String statement, Object parameter)
    • isDirty

      public boolean isDirty(DbEntity dbEntity)
    • flush

      public void flush()
      Specified by:
      flush in interface Session
    • setIgnoreForeignKeysForNextFlush

      public void setIgnoreForeignKeysForNextFlush(boolean ignoreForeignKeysForNextFlush)
    • flushDbOperationManager

      protected void flushDbOperationManager()
    • flushDbOperations

      protected void flushDbOperations(List<DbOperation> operationsToFlush, List<DbOperation> allOperations)
    • flushEntity

      public void flushEntity(DbEntity entity)
    • handleConcurrentModification

      protected void handleConcurrentModification(DbOperation dbOperation)
      Decides if an operation that failed for concurrent modifications can be tolerated, or if OptimisticLockingException should be raised
      Parameters:
      dbOperation -
      Throws:
      OptimisticLockingException - if there is no handler for the failure
    • handleConcurrentModificationWithRolledBackTransaction

      protected void handleConcurrentModificationWithRolledBackTransaction(DbOperation dbOperation)
    • canIgnoreHistoryModificationFailure

      protected boolean canIgnoreHistoryModificationFailure(DbOperation dbOperation)
      Determines if a failed database operation (OptimisticLockingException) on a Historic entity can be ignored.
      Parameters:
      dbOperation - that failed
      Returns:
      true if the failure can be ignored
    • isHistoricByteArray

      protected boolean isHistoricByteArray(DbEntity dbEntity)
    • flushEntityCache

      protected void flushEntityCache()
      Flushes the entity cache: Depending on the entity state, the required DbOperation is performed and the cache is updated.
    • flushCachedEntity

      protected void flushCachedEntity(CachedDbEntity cachedDbEntity)
    • insert

      public void insert(DbEntity dbEntity)
    • merge

      public void merge(DbEntity dbEntity)
    • forceUpdate

      public void forceUpdate(DbEntity entity)
    • delete

      public void delete(DbEntity dbEntity)
    • undoDelete

      public void undoDelete(DbEntity entity)
    • update

      public void update(Class<? extends DbEntity> entityType, String statement, Object parameter)
    • updatePreserveOrder

      public DbOperation updatePreserveOrder(Class<? extends DbEntity> entityType, String statement, Object parameter)
      Several update operations added by this method will be executed preserving the order of method calls, no matter what entity type they refer to. They will though be executed after all "not-bulk" operations (e.g. insert(DbEntity) or merge(DbEntity)) and after those updates added by update(Class, String, Object).
      Parameters:
      entityType -
      statement -
      parameter -
    • delete

      public void delete(Class<? extends DbEntity> entityType, String statement, Object parameter)
    • deletePreserveOrder

      public DbBulkOperation deletePreserveOrder(Class<? extends DbEntity> entityType, String statement, Object parameter)
      Several delete operations added by this method will be executed preserving the order of method calls, no matter what entity type they refer to. They will though be executed after all "not-bulk" operations (e.g. insert(DbEntity) or merge(DbEntity)) and after those deletes added by delete(Class, String, Object).
      Parameters:
      entityType -
      statement -
      parameter -
      Returns:
      delete operation
    • performBulkOperation

      protected DbBulkOperation performBulkOperation(Class<? extends DbEntity> entityType, String statement, Object parameter, DbOperationType operationType)
    • performBulkOperationPreserveOrder

      protected DbBulkOperation performBulkOperationPreserveOrder(Class<? extends DbEntity> entityType, String statement, Object parameter, DbOperationType operationType)
    • performEntityOperation

      protected void performEntityOperation(CachedDbEntity cachedDbEntity, DbOperationType type)
    • close

      public void close()
      Specified by:
      close in interface Session
    • isDeleted

      public boolean isDeleted(DbEntity object)
    • ensureHasId

      protected void ensureHasId(DbEntity dbEntity)
    • validateId

      protected void validateId(DbEntity dbEntity)
    • pruneDeletedEntities

      public <T extends DbEntity> List<T> pruneDeletedEntities(List<T> listToPrune)
    • contains

      public boolean contains(DbEntity dbEntity)
    • getDbOperationManager

      public DbOperationManager getDbOperationManager()
    • setDbOperationManager

      public void setDbOperationManager(DbOperationManager operationManager)
    • getDbEntityCache

      public DbEntityCache getDbEntityCache()
    • setDbEntityCache

      public void setDbEntityCache(DbEntityCache dbEntityCache)
    • createDeploymentQuery

      public DeploymentQueryImpl createDeploymentQuery()
    • createProcessDefinitionQuery

      public ProcessDefinitionQueryImpl createProcessDefinitionQuery()
    • createCaseDefinitionQuery

      public CaseDefinitionQueryImpl createCaseDefinitionQuery()
    • createProcessInstanceQuery

      public ProcessInstanceQueryImpl createProcessInstanceQuery()
    • createExecutionQuery

      public ExecutionQueryImpl createExecutionQuery()
    • createTaskQuery

      public TaskQueryImpl createTaskQuery()
    • createJobQuery

      public JobQueryImpl createJobQuery()
    • createHistoricProcessInstanceQuery

      public HistoricProcessInstanceQueryImpl createHistoricProcessInstanceQuery()
    • createHistoricActivityInstanceQuery

      public HistoricActivityInstanceQueryImpl createHistoricActivityInstanceQuery()
    • createHistoricTaskInstanceQuery

      public HistoricTaskInstanceQueryImpl createHistoricTaskInstanceQuery()
    • createHistoricDetailQuery

      public HistoricDetailQueryImpl createHistoricDetailQuery()
    • createHistoricVariableInstanceQuery

      public HistoricVariableInstanceQueryImpl createHistoricVariableInstanceQuery()
    • createHistoricJobLogQuery

      public HistoricJobLogQueryImpl createHistoricJobLogQuery()
    • createUserQuery

      public UserQueryImpl createUserQuery()
    • createGroupQuery

      public GroupQueryImpl createGroupQuery()
    • registerOptimisticLockingListener

      public void registerOptimisticLockingListener(OptimisticLockingListener optimisticLockingListener)
    • getTableNamesPresentInDatabase

      public List<String> getTableNamesPresentInDatabase()