本文整理汇总了Java中org.jooq.impl.DefaultExecuteListenerProvider类的典型用法代码示例。如果您正苦于以下问题:Java DefaultExecuteListenerProvider类的具体用法?Java DefaultExecuteListenerProvider怎么用?Java DefaultExecuteListenerProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultExecuteListenerProvider类属于org.jooq.impl包,在下文中一共展示了DefaultExecuteListenerProvider类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupDatabase
import org.jooq.impl.DefaultExecuteListenerProvider; //导入依赖的package包/类
private void setupDatabase() {
System.setProperty("org.jooq.no-logo", "true");
dataSource = dataSourceFactory.createDataSource("cattle");
DataSourceConnectionProvider dscp = new DataSourceConnectionProvider(dataSource);
ThreadLocalTransactionProvider tp = new ThreadLocalTransactionProvider(dscp, false);
LoggerListener logger = new LoggerListener();
logger.setMaxLength(1000);
ExecuteListener[] listeners = new ExecuteListener[] { logger, new StopWatchListener() };
Settings settings = dbSetting("cattle");
jooqConfig = new DefaultConfiguration()
.set(getSQLDialect("cattle"))
.set(settings)
.set(dscp)
.set(tp)
.set(DefaultExecuteListenerProvider.providers(listeners));
}
示例2: migrate
import org.jooq.impl.DefaultExecuteListenerProvider; //导入依赖的package包/类
@Override
public final void migrate(Connection connection) throws Exception {
didExecute = true;
SQLDialect dialect = JDBCUtils.dialect(connection);
if (SQLDialect.DEFAULT.equals(dialect))
throw new IllegalStateException("Dialect couldn't be deducted from connection " + connection);
Configuration configuration = new DefaultConfiguration().set(connection).set(dialect);
DdlExecuteListener listener = new DdlExecuteListener();
configuration.set(new DefaultExecuteListenerProvider(listener));
DSLContext create = DSL.using(configuration);
migrate(connection, create);
ddlInstructionExecuted = listener.ddlInstructionExecuted();
}
示例3: getDSL
import org.jooq.impl.DefaultExecuteListenerProvider; //导入依赖的package包/类
@Override
public DSLContext getDSL()
{
Configuration conf = new DefaultConfiguration()
.set(SQLDialect.MYSQL)
.set(new DataSourceConnectionProvider(this.dataSource))
.set(new DefaultExecuteListenerProvider(jooqLogger))
.set(settings)
.set(new DefaultVisitListenerProvider(new TablePrefixer(getTablePrefix())));
return DSL.using(conf);
}
示例4: init
import org.jooq.impl.DefaultExecuteListenerProvider; //导入依赖的package包/类
@PostConstruct
public void init() {
String prop = "db." + name + ".database";
String database = ArchaiusUtil.getString(prop).get();
if ( database == null ) {
throw new IllegalStateException("Failed to find config for [" + prop + "]");
}
try {
SQLDialect dialect = SQLDialect.valueOf(database.trim().toUpperCase());
set(dialect);
} catch ( IllegalArgumentException e ) {
throw new IllegalArgumentException("Invalid SQLDialect [" + database.toUpperCase() + "]", e);
}
if ( connectionProvider == null ) {
set(new AutoCommitConnectionProvider(dataSource));
} else {
set(connectionProvider);
}
settings.setRenderSchema(false);
String renderNameStyle = ArchaiusUtil.getString("db." + name + "." + database + ".render.name.style").get();
if ( renderNameStyle != null ) {
settings.setRenderNameStyle(RenderNameStyle.valueOf(renderNameStyle.trim().toUpperCase()));
}
set(settings);
if ( listeners != null && listeners.size() > 0 ) {
settings().setExecuteLogging(false);
set(DefaultExecuteListenerProvider.providers(listeners.toArray(new ExecuteListener[listeners.size()])));
}
}
示例5: init
import org.jooq.impl.DefaultExecuteListenerProvider; //导入依赖的package包/类
@PostConstruct
public void init() {
String prop = "db." + name + ".database";
String database = ArchaiusUtil.getString(prop).get();
if ( database == null ) {
throw new IllegalStateException("Failed to find config for [" + prop + "]");
}
try {
SQLDialect dialect = SQLDialect.valueOf(database.trim().toUpperCase());
set(dialect);
} catch ( IllegalArgumentException e ) {
throw new IllegalArgumentException("Invalid SQLDialect [" + database.toUpperCase() + "]", e);
}
if ( connectionProvider == null ) {
set(new AutoCommitConnectionProvider(dataSource));
} else {
set(connectionProvider);
}
Settings settings = new Settings();
settings.setRenderSchema(false);
String renderNameStyle = ArchaiusUtil.getString("db." + name + "." + database + ".render.name.style").get();
if ( renderNameStyle != null ) {
settings.setRenderNameStyle(RenderNameStyle.valueOf(renderNameStyle.trim().toUpperCase()));
}
set(settings);
if ( listeners != null && listeners.size() > 0 ) {
settings().setExecuteLogging(false);
set(DefaultExecuteListenerProvider.providers(listeners.toArray(new ExecuteListener[listeners.size()])));
}
}
示例6: setUpIntrospection
import org.jooq.impl.DefaultExecuteListenerProvider; //导入依赖的package包/类
private static void setUpIntrospection(final DSLContext context) {
context.configuration().set(new DefaultExecuteListenerProvider(new DebugExecuteListener()));
}
示例7: tracingExecuteListenerProvider
import org.jooq.impl.DefaultExecuteListenerProvider; //导入依赖的package包/类
@Bean ExecuteListenerProvider tracingExecuteListenerProvider() {
return new DefaultExecuteListenerProvider(this);
}
示例8: jooqExceptionTranslatorExecuteListenerProvider
import org.jooq.impl.DefaultExecuteListenerProvider; //导入依赖的package包/类
@Bean
public DefaultExecuteListenerProvider jooqExceptionTranslatorExecuteListenerProvider() {
return new DefaultExecuteListenerProvider(new JooqExceptionTranslator());
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:JooqAutoConfiguration.java