public final class Databases extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
Databases.Benchmarkable<R> |
static interface |
Databases.DatabaseInvoke<T,R>
Represents a logic of data process, 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 void setCurrentThreadConnection(Connection connection)
public static void clearCurrentThreadConnection()
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 installValueConverter(ForcedFieldValueConverter valueConverter)
public static <R> R executeTransactionally(String dataSourceName, Databases.TransactionalExecutor<R> executor) throws SQLException
SQLExceptionpublic static void truncateTable(String tableName) throws SQLException
SQLExceptionpublic static void truncateTable(String dataSourceName, String tableName) throws SQLException
SQLExceptionpublic static void execute(String sql) throws SQLException
SQLExceptionpublic static void execute(String dataSourceName, String sql) throws SQLException
SQLExceptionpublic static <T,R> R execute(Databases.DatabaseInvoke<T,R> databaseInvoke) throws SQLException
SQLExceptionpublic static <T,R> R execute(String dataSourceName, 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 String getDefaultDataSourceName()
public static QueryFactory getQueryFactory()
public static PersistenceFactory getPersistenceFactory()
public static SQLExecutor getSqlExecutor()
public static Quoter getQuoter()
public static LoggerFactory getLoggerFactory()
public static ForcedFieldValueConverter getValueConverter()
public static ConnectionFactory getConnectionFactory()
Copyright © 2020 com.github.braisdom. All rights reserved.