Class DbSqlSessionFactory
- java.lang.Object
-
- org.camunda.bpm.engine.impl.db.sql.DbSqlSessionFactory
-
- All Implemented Interfaces:
SessionFactory
public class DbSqlSessionFactory extends java.lang.Object implements SessionFactory
- Author:
- Tom Baeyens
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
cmmnEnabled
static java.lang.String
CRDB
protected java.lang.String
databaseSchema
In some situations you want to set the schema to use for table checks / generation if the database metadata doesn't return that correctly, see https://jira.codehaus.org/browse/ACT-1220, https://jira.codehaus.org/browse/ACT-1062static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificAuth1JoinEnd
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificAuth1JoinSeparator
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificAuth1JoinStart
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificAuthJoinEnd
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificAuthJoinSeparator
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificAuthJoinStart
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificBitAnd1
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificBitAnd2
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificBitAnd3
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificCollationForCaseSensitivity
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificCountDistinctAfterEnd
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificCountDistinctBeforeEnd
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificCountDistinctBeforeStart
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificDatepart1
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificDatepart2
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificDatepart3
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificDaysComparator
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificDistinct
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificDummyTable
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificEscapeChar
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificFalseConstant
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificIfNull
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificInnerLimitAfterStatements
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificLimitAfterStatements
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificLimitAfterWithoutOffsetStatements
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificLimitBeforeNativeQueryStatements
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificLimitBeforeStatements
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificLimitBeforeWithoutOffsetStatements
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificLimitBetweenAcquisitionStatements
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificLimitBetweenFilterStatements
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificLimitBetweenStatements
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificNumericCast
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificOrderByStatements
protected static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>
databaseSpecificStatements
static java.util.Map<java.lang.String,java.lang.String>
databaseSpecificTrueConstant
protected java.lang.String
databaseTablePrefix
protected java.lang.String
databaseType
static java.lang.String
DB2
static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>
dbSpecificConstants
protected java.util.Map<java.lang.Class<?>,java.lang.String>
deleteStatements
protected boolean
dmnEnabled
static java.lang.String
H2
protected IdGenerator
idGenerator
protected java.util.Map<java.lang.Class<?>,java.lang.String>
insertStatements
protected boolean
isDbHistoryUsed
protected boolean
isDbIdentityUsed
protected boolean
jdbcBatchProcessing
static java.lang.String
MARIADB
static int
MAXIMUM_NUMBER_PARAMS
static java.lang.String
MSSQL
static java.lang.String
MYSQL
static java.util.Map<java.lang.String,java.lang.String>
optimizeDatabaseSpecificLimitAfterWithoutOffsetStatements
static java.util.Map<java.lang.String,java.lang.String>
optimizeDatabaseSpecificLimitBeforeWithoutOffsetStatements
static java.lang.String
ORACLE
static java.lang.String
POSTGRES
protected java.util.Map<java.lang.Class<?>,java.lang.String>
selectStatements
protected org.apache.ibatis.session.SqlSessionFactory
sqlSessionFactory
protected java.util.Map<java.lang.String,java.lang.String>
statementMappings
static java.lang.String[]
SUPPORTED_DATABASES
protected java.util.Map<java.lang.Class<?>,java.lang.String>
updateStatements
-
Constructor Summary
Constructors Constructor Description DbSqlSessionFactory(boolean jdbcBatchProcessing)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static void
addDatabaseSpecificStatement(java.lang.String databaseType, java.lang.String activitiStatement, java.lang.String ibatisStatement)
java.lang.String
getDatabaseSchema()
java.lang.String
getDatabaseTablePrefix()
java.lang.String
getDatabaseType()
java.lang.String
getDeleteStatement(java.lang.Class<?> persistentObjectClass)
java.util.Map<java.lang.Class<?>,java.lang.String>
getDeleteStatements()
IdGenerator
getIdGenerator()
java.lang.String
getInsertStatement(DbEntity object)
java.util.Map<java.lang.Class<?>,java.lang.String>
getInsertStatements()
java.lang.String
getSelectStatement(java.lang.Class<?> persistentObjectClass)
java.util.Map<java.lang.Class<?>,java.lang.String>
getSelectStatements()
java.lang.Class<?>
getSessionType()
org.apache.ibatis.session.SqlSessionFactory
getSqlSessionFactory()
java.util.Map<java.lang.String,java.lang.String>
getStatementMappings()
java.lang.String
getUpdateStatement(DbEntity object)
java.util.Map<java.lang.Class<?>,java.lang.String>
getUpdateStatements()
boolean
isCmmnEnabled()
boolean
isDbHistoryUsed()
boolean
isDbIdentityUsed()
boolean
isDmnEnabled()
java.lang.String
mapStatement(java.lang.String statement)
Session
openSession()
DbSqlSession
openSession(java.sql.Connection connection, java.lang.String catalog, java.lang.String schema)
void
setCmmnEnabled(boolean cmmnEnabled)
void
setDatabaseSchema(java.lang.String databaseSchema)
void
setDatabaseTablePrefix(java.lang.String databaseTablePrefix)
void
setDatabaseType(java.lang.String databaseType)
void
setDbHistoryUsed(boolean isDbHistoryUsed)
void
setDbIdentityUsed(boolean isDbIdentityUsed)
void
setDeleteStatements(java.util.Map<java.lang.Class<?>,java.lang.String> deleteStatements)
void
setDmnEnabled(boolean dmnEnabled)
void
setIdGenerator(IdGenerator idGenerator)
void
setInsertStatements(java.util.Map<java.lang.Class<?>,java.lang.String> insertStatements)
void
setSelectStatements(java.util.Map<java.lang.Class<?>,java.lang.String> selectStatements)
void
setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory)
void
setStatementMappings(java.util.Map<java.lang.String,java.lang.String> statementMappings)
void
setUpdateStatements(java.util.Map<java.lang.Class<?>,java.lang.String> updateStatements)
-
-
-
Field Detail
-
MSSQL
public static final java.lang.String MSSQL
- See Also:
- Constant Field Values
-
DB2
public static final java.lang.String DB2
- See Also:
- Constant Field Values
-
ORACLE
public static final java.lang.String ORACLE
- See Also:
- Constant Field Values
-
H2
public static final java.lang.String H2
- See Also:
- Constant Field Values
-
MYSQL
public static final java.lang.String MYSQL
- See Also:
- Constant Field Values
-
POSTGRES
public static final java.lang.String POSTGRES
- See Also:
- Constant Field Values
-
MARIADB
public static final java.lang.String MARIADB
- See Also:
- Constant Field Values
-
CRDB
public static final java.lang.String CRDB
- See Also:
- Constant Field Values
-
SUPPORTED_DATABASES
public static final java.lang.String[] SUPPORTED_DATABASES
-
databaseSpecificStatements
protected static final java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> databaseSpecificStatements
-
databaseSpecificLimitBeforeStatements
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificLimitBeforeStatements
-
databaseSpecificLimitAfterStatements
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificLimitAfterStatements
-
databaseSpecificLimitBeforeWithoutOffsetStatements
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificLimitBeforeWithoutOffsetStatements
-
databaseSpecificLimitAfterWithoutOffsetStatements
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificLimitAfterWithoutOffsetStatements
-
databaseSpecificInnerLimitAfterStatements
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificInnerLimitAfterStatements
-
databaseSpecificLimitBetweenStatements
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificLimitBetweenStatements
-
databaseSpecificLimitBetweenFilterStatements
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificLimitBetweenFilterStatements
-
databaseSpecificLimitBetweenAcquisitionStatements
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificLimitBetweenAcquisitionStatements
-
databaseSpecificCountDistinctBeforeStart
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificCountDistinctBeforeStart
-
databaseSpecificCountDistinctBeforeEnd
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificCountDistinctBeforeEnd
-
databaseSpecificCountDistinctAfterEnd
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificCountDistinctAfterEnd
-
optimizeDatabaseSpecificLimitBeforeWithoutOffsetStatements
public static final java.util.Map<java.lang.String,java.lang.String> optimizeDatabaseSpecificLimitBeforeWithoutOffsetStatements
-
optimizeDatabaseSpecificLimitAfterWithoutOffsetStatements
public static final java.util.Map<java.lang.String,java.lang.String> optimizeDatabaseSpecificLimitAfterWithoutOffsetStatements
-
databaseSpecificEscapeChar
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificEscapeChar
-
databaseSpecificOrderByStatements
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificOrderByStatements
-
databaseSpecificLimitBeforeNativeQueryStatements
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificLimitBeforeNativeQueryStatements
-
databaseSpecificBitAnd1
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificBitAnd1
-
databaseSpecificBitAnd2
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificBitAnd2
-
databaseSpecificBitAnd3
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificBitAnd3
-
databaseSpecificDatepart1
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificDatepart1
-
databaseSpecificDatepart2
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificDatepart2
-
databaseSpecificDatepart3
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificDatepart3
-
databaseSpecificDummyTable
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificDummyTable
-
databaseSpecificIfNull
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificIfNull
-
databaseSpecificTrueConstant
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificTrueConstant
-
databaseSpecificFalseConstant
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificFalseConstant
-
databaseSpecificDistinct
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificDistinct
-
databaseSpecificNumericCast
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificNumericCast
-
dbSpecificConstants
public static final java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> dbSpecificConstants
-
databaseSpecificDaysComparator
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificDaysComparator
-
databaseSpecificCollationForCaseSensitivity
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificCollationForCaseSensitivity
-
databaseSpecificAuthJoinStart
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificAuthJoinStart
-
databaseSpecificAuthJoinEnd
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificAuthJoinEnd
-
databaseSpecificAuthJoinSeparator
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificAuthJoinSeparator
-
databaseSpecificAuth1JoinStart
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificAuth1JoinStart
-
databaseSpecificAuth1JoinEnd
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificAuth1JoinEnd
-
databaseSpecificAuth1JoinSeparator
public static final java.util.Map<java.lang.String,java.lang.String> databaseSpecificAuth1JoinSeparator
-
MAXIMUM_NUMBER_PARAMS
public static final int MAXIMUM_NUMBER_PARAMS
- See Also:
- Constant Field Values
-
databaseType
protected java.lang.String databaseType
-
databaseTablePrefix
protected java.lang.String databaseTablePrefix
-
databaseSchema
protected java.lang.String databaseSchema
In some situations you want to set the schema to use for table checks / generation if the database metadata doesn't return that correctly, see https://jira.codehaus.org/browse/ACT-1220, https://jira.codehaus.org/browse/ACT-1062
-
sqlSessionFactory
protected org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory
-
idGenerator
protected IdGenerator idGenerator
-
statementMappings
protected java.util.Map<java.lang.String,java.lang.String> statementMappings
-
insertStatements
protected java.util.Map<java.lang.Class<?>,java.lang.String> insertStatements
-
updateStatements
protected java.util.Map<java.lang.Class<?>,java.lang.String> updateStatements
-
deleteStatements
protected java.util.Map<java.lang.Class<?>,java.lang.String> deleteStatements
-
selectStatements
protected java.util.Map<java.lang.Class<?>,java.lang.String> selectStatements
-
isDbIdentityUsed
protected boolean isDbIdentityUsed
-
isDbHistoryUsed
protected boolean isDbHistoryUsed
-
cmmnEnabled
protected boolean cmmnEnabled
-
dmnEnabled
protected boolean dmnEnabled
-
jdbcBatchProcessing
protected boolean jdbcBatchProcessing
-
-
Method Detail
-
getSessionType
public java.lang.Class<?> getSessionType()
- Specified by:
getSessionType
in interfaceSessionFactory
-
openSession
public Session openSession()
- Specified by:
openSession
in interfaceSessionFactory
-
openSession
public DbSqlSession openSession(java.sql.Connection connection, java.lang.String catalog, java.lang.String schema)
-
getInsertStatement
public java.lang.String getInsertStatement(DbEntity object)
-
getUpdateStatement
public java.lang.String getUpdateStatement(DbEntity object)
-
getDeleteStatement
public java.lang.String getDeleteStatement(java.lang.Class<?> persistentObjectClass)
-
getSelectStatement
public java.lang.String getSelectStatement(java.lang.Class<?> persistentObjectClass)
-
addDatabaseSpecificStatement
protected static void addDatabaseSpecificStatement(java.lang.String databaseType, java.lang.String activitiStatement, java.lang.String ibatisStatement)
-
mapStatement
public java.lang.String mapStatement(java.lang.String statement)
-
setDatabaseType
public void setDatabaseType(java.lang.String databaseType)
-
getSqlSessionFactory
public org.apache.ibatis.session.SqlSessionFactory getSqlSessionFactory()
-
setSqlSessionFactory
public void setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory)
-
getIdGenerator
public IdGenerator getIdGenerator()
-
setIdGenerator
public void setIdGenerator(IdGenerator idGenerator)
-
getDatabaseType
public java.lang.String getDatabaseType()
-
getStatementMappings
public java.util.Map<java.lang.String,java.lang.String> getStatementMappings()
-
setStatementMappings
public void setStatementMappings(java.util.Map<java.lang.String,java.lang.String> statementMappings)
-
getInsertStatements
public java.util.Map<java.lang.Class<?>,java.lang.String> getInsertStatements()
-
setInsertStatements
public void setInsertStatements(java.util.Map<java.lang.Class<?>,java.lang.String> insertStatements)
-
getUpdateStatements
public java.util.Map<java.lang.Class<?>,java.lang.String> getUpdateStatements()
-
setUpdateStatements
public void setUpdateStatements(java.util.Map<java.lang.Class<?>,java.lang.String> updateStatements)
-
getDeleteStatements
public java.util.Map<java.lang.Class<?>,java.lang.String> getDeleteStatements()
-
setDeleteStatements
public void setDeleteStatements(java.util.Map<java.lang.Class<?>,java.lang.String> deleteStatements)
-
getSelectStatements
public java.util.Map<java.lang.Class<?>,java.lang.String> getSelectStatements()
-
setSelectStatements
public void setSelectStatements(java.util.Map<java.lang.Class<?>,java.lang.String> selectStatements)
-
isDbIdentityUsed
public boolean isDbIdentityUsed()
-
setDbIdentityUsed
public void setDbIdentityUsed(boolean isDbIdentityUsed)
-
isDbHistoryUsed
public boolean isDbHistoryUsed()
-
setDbHistoryUsed
public void setDbHistoryUsed(boolean isDbHistoryUsed)
-
isCmmnEnabled
public boolean isCmmnEnabled()
-
setCmmnEnabled
public void setCmmnEnabled(boolean cmmnEnabled)
-
isDmnEnabled
public boolean isDmnEnabled()
-
setDmnEnabled
public void setDmnEnabled(boolean dmnEnabled)
-
setDatabaseTablePrefix
public void setDatabaseTablePrefix(java.lang.String databaseTablePrefix)
-
getDatabaseTablePrefix
public java.lang.String getDatabaseTablePrefix()
-
getDatabaseSchema
public java.lang.String getDatabaseSchema()
-
setDatabaseSchema
public void setDatabaseSchema(java.lang.String databaseSchema)
-
-