Class DbSqlSession
- java.lang.Object
-
- org.flowable.common.engine.impl.db.DbSqlSession
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Class<? extends Entity>,List<BulkDeleteOperation>>bulkDeleteOperationsprotected StringconnectionMetadataDefaultCatalogprotected StringconnectionMetadataDefaultSchemaprotected DbSqlSessionFactorydbSqlSessionFactoryprotected Map<Class<? extends Entity>,Map<String,Entity>>deletedObjectsprotected EntityCacheentityCacheprotected Map<Class<? extends Entity>,Map<String,Entity>>insertedObjectsstatic String[]JDBC_METADATA_TABLE_TYPESprotected org.apache.ibatis.session.SqlSessionsqlSessionprotected List<Entity>updatedObjects
-
Constructor Summary
Constructors Constructor Description DbSqlSession(DbSqlSessionFactory dbSqlSessionFactory, EntityCache entityCache)DbSqlSession(DbSqlSessionFactory dbSqlSessionFactory, EntityCache entityCache, Connection connection, String catalog, String schema)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ListcacheLoadOrStore(List<Object> loadedObjects, Object parameter)protected EntitycacheLoadOrStore(Entity entity, Object parameter)Returns the object in the cache.voidclose()voidcommit()protected voiddebugFlush()voiddelete(String statement, Object parameter, Class<? extends Entity> entityClass)Executes aBulkDeleteOperation, with the sql in the statement parameter.voiddelete(Entity entity)voiddetermineUpdatedObjects()intdirectInsert(String statement, Object parameters)intdirectUpdate(String statement, Object parameters)voidflush()protected voidflushBulkDeletes(Class<? extends Entity> entityClass, List<BulkDeleteOperation> deleteOperations)protected voidflushBulkInsert(Collection<Entity> entities, Class<? extends Entity> clazz)protected voidflushDeleteEntities(Class<? extends Entity> entityClass, Collection<Entity> entitiesToDelete)protected voidflushDeletes()protected voidflushInsertEntities(Class<? extends Entity> entityClass, Collection<Entity> entitiesToInsert)protected voidflushInserts()protected voidflushRegularInsert(Entity entity, Class<? extends Entity> clazz)protected voidflushUpdates()StringgetConnectionMetadataDefaultCatalog()StringgetConnectionMetadataDefaultSchema()<T> TgetCustomMapper(Class<T> type)DbSqlSessionFactorygetDbSqlSessionFactory()org.apache.ibatis.session.SqlSessiongetSqlSession()protected voidincrementRevision(Entity insertedObject)voidinsert(Entity entity, IdGenerator idGenerator)booleanisEntityInserted(Class<?> entityClass, String entityId)booleanisEntityInserted(Entity entity)booleanisEntityToBeDeleted(Entity entity)ListqueryWithRawParameter(String statement, CacheAwareQuery parameter, Class entityClass, boolean cacheLoadAndStore)ListqueryWithRawParameterNoCacheLoadAndStore(String statement, CacheAwareQuery parameter, Class entityClass)protected voidremoveUnnecessaryOperations()Clears all deleted and inserted objects from the cache, and removes inserts and deletes that cancel each other.voidrollback()<T extends Entity>
TselectById(Class<T> entityClass, String id)<T extends Entity>
TselectById(Class<T> entityClass, String id, boolean useCache)ListselectList(String statement)ListselectList(String statement, Object parameter)ListselectList(String statement, Object parameter, int firstResult, int maxResults)ListselectList(String statement, Object parameter, Page page)ListselectList(String statement, ListQueryParameterObject parameter)ListselectList(String statement, ListQueryParameterObject parameter, Class entityClass)ListselectListNoCacheLoadAndStore(String statement, Object parameter)ListselectListNoCacheLoadAndStore(String statement, ListQueryParameterObject parameter)ListselectListNoCacheLoadAndStore(String statement, ListQueryParameterObject parameter, Class entityClass)ListselectListWithRawParameter(String statement, Object parameter)ListselectListWithRawParameter(String statement, Object parameter, boolean useCache)ListselectListWithRawParameterNoCacheLoadAndStore(String statement, Object parameter)ListselectListWithRawParameterNoCacheLoadAndStore(String statement, ListQueryParameterObject parameter)ListselectListWithRawParameterNoCacheLoadAndStore(String statement, ListQueryParameterObject parameter, Class entityClass)ObjectselectOne(String statement, Object parameter)voidsetConnectionMetadataDefaultCatalog(String connectionMetadataDefaultCatalog)voidsetConnectionMetadataDefaultSchema(String connectionMetadataDefaultSchema)voidupdate(Entity entity)
-
-
-
Field Detail
-
JDBC_METADATA_TABLE_TYPES
public static String[] JDBC_METADATA_TABLE_TYPES
-
entityCache
protected EntityCache entityCache
-
sqlSession
protected org.apache.ibatis.session.SqlSession sqlSession
-
dbSqlSessionFactory
protected DbSqlSessionFactory dbSqlSessionFactory
-
connectionMetadataDefaultCatalog
protected String connectionMetadataDefaultCatalog
-
connectionMetadataDefaultSchema
protected String connectionMetadataDefaultSchema
-
bulkDeleteOperations
protected Map<Class<? extends Entity>,List<BulkDeleteOperation>> bulkDeleteOperations
-
-
Constructor Detail
-
DbSqlSession
public DbSqlSession(DbSqlSessionFactory dbSqlSessionFactory, EntityCache entityCache)
-
DbSqlSession
public DbSqlSession(DbSqlSessionFactory dbSqlSessionFactory, EntityCache entityCache, Connection connection, String catalog, String schema)
-
-
Method Detail
-
insert
public void insert(Entity entity, IdGenerator idGenerator)
-
update
public void update(Entity entity)
-
delete
public void delete(String statement, Object parameter, Class<? extends Entity> entityClass)
Executes aBulkDeleteOperation, with the sql in the statement parameter. The passed class determines when this operation will be executed: it will be executed depending on the place of the class in the EntityDependencyOrder.
-
delete
public void delete(Entity entity)
-
selectList
public List selectList(String statement, ListQueryParameterObject parameter)
-
selectList
public List selectList(String statement, ListQueryParameterObject parameter, Class entityClass)
-
selectList
public List selectList(String statement, Object parameter, int firstResult, int maxResults)
-
selectListNoCacheLoadAndStore
public List selectListNoCacheLoadAndStore(String statement, Object parameter)
-
selectListWithRawParameterNoCacheLoadAndStore
public List selectListWithRawParameterNoCacheLoadAndStore(String statement, Object parameter)
-
selectListWithRawParameterNoCacheLoadAndStore
public List selectListWithRawParameterNoCacheLoadAndStore(String statement, ListQueryParameterObject parameter, Class entityClass)
-
selectListWithRawParameterNoCacheLoadAndStore
public List selectListWithRawParameterNoCacheLoadAndStore(String statement, ListQueryParameterObject parameter)
-
selectListNoCacheLoadAndStore
public List selectListNoCacheLoadAndStore(String statement, ListQueryParameterObject parameter, Class entityClass)
-
selectListNoCacheLoadAndStore
public List selectListNoCacheLoadAndStore(String statement, ListQueryParameterObject parameter)
-
selectListWithRawParameter
public List selectListWithRawParameter(String statement, Object parameter)
-
queryWithRawParameter
public List queryWithRawParameter(String statement, CacheAwareQuery parameter, Class entityClass, boolean cacheLoadAndStore)
-
queryWithRawParameterNoCacheLoadAndStore
public List queryWithRawParameterNoCacheLoadAndStore(String statement, CacheAwareQuery parameter, Class entityClass)
-
selectListWithRawParameter
public List selectListWithRawParameter(String statement, Object parameter, boolean useCache)
-
selectById
public <T extends Entity> T selectById(Class<T> entityClass, String id, boolean useCache)
-
cacheLoadOrStore
protected Entity cacheLoadOrStore(Entity entity, Object parameter)
Returns the object in the cache. If this object was loaded before, then the original object is returned (the cached version is more recent). If this is the first time this object is loaded, then the loadedObject is added to the cache.
-
removeUnnecessaryOperations
protected void removeUnnecessaryOperations()
Clears all deleted and inserted objects from the cache, and removes inserts and deletes that cancel each other. Also removes deletes with duplicate ids.
-
determineUpdatedObjects
public void determineUpdatedObjects()
-
debugFlush
protected void debugFlush()
-
isEntityInserted
public boolean isEntityInserted(Entity entity)
-
isEntityToBeDeleted
public boolean isEntityToBeDeleted(Entity entity)
-
flushInserts
protected void flushInserts()
-
flushInsertEntities
protected void flushInsertEntities(Class<? extends Entity> entityClass, Collection<Entity> entitiesToInsert)
-
flushBulkInsert
protected void flushBulkInsert(Collection<Entity> entities, Class<? extends Entity> clazz)
-
incrementRevision
protected void incrementRevision(Entity insertedObject)
-
flushUpdates
protected void flushUpdates()
-
flushDeletes
protected void flushDeletes()
-
flushBulkDeletes
protected void flushBulkDeletes(Class<? extends Entity> entityClass, List<BulkDeleteOperation> deleteOperations)
-
flushDeleteEntities
protected void flushDeleteEntities(Class<? extends Entity> entityClass, Collection<Entity> entitiesToDelete)
-
commit
public void commit()
-
rollback
public void rollback()
-
getCustomMapper
public <T> T getCustomMapper(Class<T> type)
-
getSqlSession
public org.apache.ibatis.session.SqlSession getSqlSession()
-
getDbSqlSessionFactory
public DbSqlSessionFactory getDbSqlSessionFactory()
-
getConnectionMetadataDefaultCatalog
public String getConnectionMetadataDefaultCatalog()
-
setConnectionMetadataDefaultCatalog
public void setConnectionMetadataDefaultCatalog(String connectionMetadataDefaultCatalog)
-
getConnectionMetadataDefaultSchema
public String getConnectionMetadataDefaultSchema()
-
setConnectionMetadataDefaultSchema
public void setConnectionMetadataDefaultSchema(String connectionMetadataDefaultSchema)
-
-