Class DbEntityManager

    • Method Detail

      • initializeOperationManager

        protected void initializeOperationManager()
      • initializeEntityCache

        protected void initializeEntityCache()
      • selectList

        public java.util.List selectList​(java.lang.String statement)
      • selectList

        public java.util.List selectList​(java.lang.String statement,
                                         java.lang.Object parameter)
      • selectList

        public java.util.List selectList​(java.lang.String statement,
                                         java.lang.Object parameter,
                                         Page page)
      • selectList

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

        public java.util.List selectListWithRawParameter​(java.lang.String statement,
                                                         java.lang.Object parameter,
                                                         int firstResult,
                                                         int maxResults)
      • selectOne

        public java.lang.Object selectOne​(java.lang.String statement,
                                          java.lang.Object parameter)
      • selectBoolean

        public boolean selectBoolean​(java.lang.String statement,
                                     java.lang.Object parameter)
      • selectById

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

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

        public <T extends DbEntity> java.util.List<T> getCachedEntitiesByType​(java.lang.Class<T> type)
      • filterLoadedObjects

        protected java.util.List filterLoadedObjects​(java.util.List<java.lang.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​(java.lang.String statement)
      • lock

        public void lock​(java.lang.String statement,
                         java.lang.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​(java.util.List<DbOperation> operationsToFlush,
                                         java.util.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
      • 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)
      • update

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

        public void updatePreserveOrder​(java.lang.Class<? extends DbEntity> entityType,
                                        java.lang.String statement,
                                        java.lang.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​(java.lang.Class<? extends DbEntity> entityType,
                           java.lang.String statement,
                           java.lang.Object parameter)
      • deletePreserveOrder

        public DbBulkOperation deletePreserveOrder​(java.lang.Class<? extends DbEntity> entityType,
                                                   java.lang.String statement,
                                                   java.lang.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​(java.lang.Class<? extends DbEntity> entityType,
                                                       java.lang.String statement,
                                                       java.lang.Object parameter,
                                                       DbOperationType operationType)
      • performBulkOperationPreserveOrder

        protected DbBulkOperation performBulkOperationPreserveOrder​(java.lang.Class<? extends DbEntity> entityType,
                                                                    java.lang.String statement,
                                                                    java.lang.Object parameter,
                                                                    DbOperationType operationType)
      • 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> java.util.List<T> pruneDeletedEntities​(java.util.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 java.util.List<java.lang.String> getTableNamesPresentInDatabase()