public final class Databases extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
Databases.Benchmarkable<R> |
static interface |
Databases.DatabaseInvoke<T,R>
Represents a logic of data , it will provide the connection and sql
executor of database, and the concrete logic will be ignored the behavior
about connection.
|
static interface |
Databases.TransactionalExecutor<R>
Represents logic will be executed in the transaction(There's only one
connection of database)
|
| 构造器和说明 |
|---|
Databases() |
public static ThreadLocal<Connection> getConnectionThreadLocal()
public static void setCurrentDataSourceName(String name)
name - public static void clearCurrentDataSourceName()
name - public static String getCurrentDataSourceName()
name - public static void installConnectionFactory(ConnectionFactory connectionFactory)
public static void installSqlExecutor(SQLExecutor sqlExecutor)
public static void installQueryFacotry(QueryFactory queryFactory)
public static void installPersistenceFactory(PersistenceFactory persistenceFactory)
public static void installLoggerFactory(LoggerFactory loggerFactory)
public static void installQuoter(Quoter quoter)
public static void installStandardDataTypeRiser(JDBCDataTypeRiser JDBCDataTypeRiser)
public static <R> R executeTransactionally(Databases.TransactionalExecutor<R> executor) throws SQLException
SQLExceptionpublic static <T,R> R execute(Databases.DatabaseInvoke<T,R> databaseInvoke) throws SQLException
SQLExceptionpublic static <R> R sqlBenchmarking(Databases.Benchmarkable<R> benchmarkable, Logger logger, String message, Object... params) throws SQLException
SQLExceptionpublic static QueryFactory getQueryFactory()
public static PersistenceFactory getPersistenceFactory()
public static SQLExecutor getSqlExecutor()
public static Quoter getQuoter()
public static LoggerFactory getLoggerFactory()
public static JDBCDataTypeRiser getJdbcDataTypeRiser()
public static ConnectionFactory getConnectionFactory()
Copyright © 2020 com.github.braisdom. All rights reserved.