Class DbSqlSession
java.lang.Object
org.flowable.common.engine.impl.db.DbSqlSession
- All Implemented Interfaces:
Session
- Direct Known Subclasses:
ProfilingDbSqlSession
- Author:
- Tom Baeyens, Joram Barrez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<Class<? extends Entity>,List<BulkDeleteOperation>> protected List<BulkUpdateOperation>protected Stringprotected Stringprotected DbSqlSessionFactoryprotected EntityCachestatic String[]protected org.apache.ibatis.session.SqlSession -
Constructor Summary
ConstructorsConstructorDescriptionDbSqlSession(DbSqlSessionFactory dbSqlSessionFactory, EntityCache entityCache) DbSqlSession(DbSqlSessionFactory dbSqlSessionFactory, EntityCache entityCache, Connection connection, String catalog, String schema) -
Method Summary
Modifier and TypeMethodDescriptionprotected ListcacheLoadOrStore(List<Object> loadedObjects, Object parameter) protected EntitycacheLoadOrStore(Entity entity, Object parameter) Returns the object in the cache.voidclose()voidcommit()protected voidvoidExecutes aBulkDeleteOperation, with the sql in the statement parameter.voidvoidintdirectInsert(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 voidflushBulkUpdate(BulkUpdateOperation bulkUpdateOperation) protected voidflushDeleteEntities(Class<? extends Entity> entityClass, Collection<Entity> entitiesToDelete) protected voidprotected voidflushInsertEntities(Class<? extends Entity> entityClass, Collection<Entity> entitiesToInsert) protected voidprotected voidflushRegularInsert(Entity entity, Class<? extends Entity> clazz) protected voidflushUpdateEntity(Entity updatedObject) protected void<T> TgetCustomMapper(Class<T> type) org.apache.ibatis.session.SqlSessionprotected voidincrementRevision(Entity insertedObject) voidinsert(Entity entity, IdGenerator idGenerator) booleanisEntityInserted(Class<?> entityClass, String entityId) booleanisEntityInserted(Entity entity) booleanisEntityToBeDeleted(Entity entity) queryWithRawParameter(String statement, CacheAwareQuery parameter, Class entityClass, boolean cacheLoadAndStore) queryWithRawParameterNoCacheLoadAndStore(String statement, CacheAwareQuery parameter, Class entityClass) protected voidClears 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) selectList(String statement) selectList(String statement, Object parameter) selectList(String statement, Object parameter, int firstResult, int maxResults) selectList(String statement, Object parameter, Page page) selectList(String statement, ListQueryParameterObject parameter) selectList(String statement, ListQueryParameterObject parameter, Class entityClass) selectListNoCacheLoadAndStore(String statement, Object parameter) selectListNoCacheLoadAndStore(String statement, ListQueryParameterObject parameter) selectListNoCacheLoadAndStore(String statement, ListQueryParameterObject parameter, Class entityClass) selectListWithRawParameter(String statement, Object parameter) selectListWithRawParameter(String statement, Object parameter, boolean useCache) selectListWithRawParameterNoCacheLoadAndStore(String statement, Object parameter) selectListWithRawParameterNoCacheLoadAndStore(String statement, ListQueryParameterObject parameter) selectListWithRawParameterNoCacheLoadAndStore(String statement, ListQueryParameterObject parameter, Class entityClass) voidsetConnectionMetadataDefaultCatalog(String connectionMetadataDefaultCatalog) voidsetConnectionMetadataDefaultSchema(String connectionMetadataDefaultSchema) voidExecutes aBulkUpdateOperation, with the sql in the statement parameter.void
-
Field Details
-
JDBC_METADATA_TABLE_TYPES
-
entityCache
-
sqlSession
protected org.apache.ibatis.session.SqlSession sqlSession -
dbSqlSessionFactory
-
connectionMetadataDefaultCatalog
-
connectionMetadataDefaultSchema
-
insertedObjects
-
deletedObjects
-
bulkDeleteOperations
-
updatedObjects
-
bulkUpdateOperations
-
-
Constructor Details
-
DbSqlSession
-
DbSqlSession
public DbSqlSession(DbSqlSessionFactory dbSqlSessionFactory, EntityCache entityCache, Connection connection, String catalog, String schema)
-
-
Method Details
-
insert
-
directInsert
-
update
-
update
Executes aBulkUpdateOperation, with the sql in the statement parameter. -
directUpdate
-
delete
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
-
selectList
-
selectList
-
selectList
-
selectList
-
selectList
-
selectList
-
selectListNoCacheLoadAndStore
-
selectListWithRawParameterNoCacheLoadAndStore
-
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
-
selectListWithRawParameter
-
queryWithRawParameter
public List queryWithRawParameter(String statement, CacheAwareQuery parameter, Class entityClass, boolean cacheLoadAndStore) -
queryWithRawParameterNoCacheLoadAndStore
public List queryWithRawParameterNoCacheLoadAndStore(String statement, CacheAwareQuery parameter, Class entityClass) -
selectListWithRawParameter
-
selectOne
-
selectById
-
selectById
-
cacheLoadOrStore
-
cacheLoadOrStore
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. -
flush
public void flush() -
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
-
isEntityInserted
-
isEntityToBeDeleted
-
flushInserts
protected void flushInserts() -
flushInsertEntities
protected void flushInsertEntities(Class<? extends Entity> entityClass, Collection<Entity> entitiesToInsert) -
flushRegularInsert
-
flushBulkInsert
-
incrementRevision
-
flushUpdates
protected void flushUpdates() -
flushUpdateEntity
-
flushBulkUpdate
-
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) -
close
public void close() -
commit
public void commit() -
rollback
public void rollback() -
getCustomMapper
-
getSqlSession
public org.apache.ibatis.session.SqlSession getSqlSession() -
getDbSqlSessionFactory
-
getConnectionMetadataDefaultCatalog
-
setConnectionMetadataDefaultCatalog
-
getConnectionMetadataDefaultSchema
-
setConnectionMetadataDefaultSchema
-