use of com.alessiodp.core.common.storage.sql.migrator.MigratorConfiguration in project ADP-Core by AlessioDP.
the class SQLDispatcher method init.
@Override
public void init() {
// Initialize DAO
connectionFactory = initConnectionFactory();
// Check if initialized
if (connectionFactory != null) {
connectionFactory.init();
// Check for failures
if (!connectionFactory.isFailed()) {
// Setup logger
connectionFactory.getJdbi().setSqlLogger(new SqlLogger() {
@Override
public void logBeforeExecution(StatementContext context) {
plugin.getLoggerManager().logDebug(String.format(Constants.DEBUG_DB_QUERY_EXECUTE, context.getRenderedSql()), true);
}
});
try {
MigratorConfiguration migratorConfiguration = prepareMigrator();
migrateTables(migratorConfiguration.load(plugin, this));
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
}
}
Aggregations