public class Config extends Object
Constructor and Description |
---|
Config(String name,
DataSource dataSource)
Constructor with name and dataSource
|
Config(String name,
DataSource dataSource,
Dialect dialect)
Constructor with name, dataSource and dialect
|
Config(String name,
DataSource dataSource,
Dialect dialect,
boolean showSql,
boolean devMode,
int transactionLevel,
IContainerFactory containerFactory,
ICache cache)
Constructor with full parameters
|
Modifier and Type | Method and Description |
---|---|
void |
close(Connection conn) |
void |
close(ResultSet rs,
Statement st,
Connection conn)
Close ResultSet、Statement、Connection
ThreadLocal support declare transaction.
|
void |
close(Statement st,
Connection conn) |
ICache |
getCache() |
Connection |
getConnection()
Get Connection.
|
IContainerFactory |
getContainerFactory() |
DataSource |
getDataSource() |
IDbProFactory |
getDbProFactory() |
Dialect |
getDialect() |
String |
getName() |
SqlKit |
getSqlKit() |
Connection |
getThreadLocalConnection()
Helps to implement nested transaction.
|
int |
getTransactionLevel() |
boolean |
isDevMode() |
boolean |
isInTransaction()
Return true if current thread in transaction.
|
boolean |
isShowSql() |
void |
removeThreadLocalConnection() |
void |
setThreadLocalConnection(Connection connection)
Support transaction with Transaction interceptor
|
public Config(String name, DataSource dataSource, Dialect dialect, boolean showSql, boolean devMode, int transactionLevel, IContainerFactory containerFactory, ICache cache)
name
- the name of the configdataSource
- the dataSourcedialect
- the dialectshowSql
- the showSqldevMode
- the devModetransactionLevel
- the transaction levelcontainerFactory
- the containerFactorycache
- the cachepublic Config(String name, DataSource dataSource)
public Config(String name, DataSource dataSource, Dialect dialect)
public String getName()
public SqlKit getSqlKit()
public Dialect getDialect()
public ICache getCache()
public int getTransactionLevel()
public DataSource getDataSource()
public IContainerFactory getContainerFactory()
public IDbProFactory getDbProFactory()
public boolean isShowSql()
public boolean isDevMode()
public final void setThreadLocalConnection(Connection connection)
public final void removeThreadLocalConnection()
public final Connection getConnection() throws SQLException
SQLException
public final Connection getThreadLocalConnection()
public final boolean isInTransaction()
public final void close(ResultSet rs, Statement st, Connection conn)
public final void close(Statement st, Connection conn)
public final void close(Connection conn)
Copyright © 2018. All rights reserved.