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 String
protected String
protected DbSqlSessionFactory
protected EntityCache
static 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 List
cacheLoadOrStore
(List<Object> loadedObjects, Object parameter) protected Entity
cacheLoadOrStore
(Entity entity, Object parameter) Returns the object in the cache.void
close()
void
commit()
protected void
void
Executes aBulkDeleteOperation
, with the sql in the statement parameter.void
void
int
directInsert
(String statement, Object parameters) int
directUpdate
(String statement, Object parameters) void
flush()
protected void
flushBulkDeletes
(Class<? extends Entity> entityClass, List<BulkDeleteOperation> deleteOperations) protected void
flushBulkInsert
(Collection<Entity> entities, Class<? extends Entity> clazz) protected void
flushBulkUpdate
(BulkUpdateOperation bulkUpdateOperation) protected void
flushDeleteEntities
(Class<? extends Entity> entityClass, Collection<Entity> entitiesToDelete) protected void
protected void
flushInsertEntities
(Class<? extends Entity> entityClass, Collection<Entity> entitiesToInsert) protected void
protected void
flushRegularInsert
(Entity entity, Class<? extends Entity> clazz) protected void
flushUpdateEntity
(Entity updatedObject) protected void
<T> T
getCustomMapper
(Class<T> type) org.apache.ibatis.session.SqlSession
protected void
incrementRevision
(Entity insertedObject) void
insert
(Entity entity, IdGenerator idGenerator) boolean
isEntityInserted
(Class<?> entityClass, String entityId) boolean
isEntityInserted
(Entity entity) boolean
isEntityToBeDeleted
(Entity entity) queryWithRawParameter
(String statement, CacheAwareQuery parameter, Class entityClass, boolean cacheLoadAndStore) queryWithRawParameterNoCacheLoadAndStore
(String statement, CacheAwareQuery parameter, Class entityClass) protected void
Clears all deleted and inserted objects from the cache, and removes inserts and deletes that cancel each other.void
rollback()
<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) void
setConnectionMetadataDefaultCatalog
(String connectionMetadataDefaultCatalog) void
setConnectionMetadataDefaultSchema
(String connectionMetadataDefaultSchema) void
Executes 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
-