public class Config extends Object
| 构造器和说明 |
|---|
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
|
| 限定符和类型 | 方法和说明 |
|---|---|
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 void setThreadLocalConnection(Connection connection)
public void removeThreadLocalConnection()
public Connection getConnection() throws SQLException
SQLExceptionpublic Connection getThreadLocalConnection()
public boolean isInTransaction()
public void close(ResultSet rs, Statement st, Connection conn)
public void close(Statement st, Connection conn)
public void close(Connection conn)
Copyright © 2022. All rights reserved.