Class DbEntityManager

    • Method Detail

      • initializeOperationManager

        protected void initializeOperationManager()
      • initializeEntityCache

        protected void initializeEntityCache()
      • selectList

        public List selectList​(String statement)
      • selectList

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

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

        public boolean selectBoolean​(String statement,
                                     Object parameter)
      • getCachedEntity

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

        public <T extends DbEntityList<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.
      • 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()
      • 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
      • handleConcurrentModificationCrdb

        protected void handleConcurrentModificationCrdb​(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)
      • updatePreserveOrder

        public void 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 -
      • 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
      • 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 DbEntityList<T> pruneDeletedEntities​(List<T> listToPrune)
      • contains

        public boolean contains​(DbEntity dbEntity)
      • setDbOperationManager

        public void setDbOperationManager​(DbOperationManager operationManager)
      • setDbEntityCache

        public void setDbEntityCache​(DbEntityCache dbEntityCache)
      • registerOptimisticLockingListener

        public void registerOptimisticLockingListener​(OptimisticLockingListener optimisticLockingListener)
      • getTableNamesPresentInDatabase

        public List<String> getTableNamesPresentInDatabase()