use of org.apache.torque.engine.database.model.UnifiedSchema in project dbflute-core by dbflute.
the class DfSchemaInitializerFactory method setupSchemaInitializerJdbcProperties.
protected void setupSchemaInitializerJdbcProperties(DfSchemaInitializerJdbc initializer) {
setupDetailExecutionHandling(initializer);
if (_initializeType.equals(InitializeType.MAIN)) {
initializer.setDataSource(_dataSource);
initializer.setUnifiedSchema(_databaseProperties.getDatabaseSchema());
initializer.setDropObjectTypeList(_replaceSchemaProperties.getObjectTypeTargetList());
initializer.setInitializeFirstSqlList(_replaceSchemaProperties.getInitializeFirstSqlList());
initializer.setDropTableExceptList(_replaceSchemaProperties.getDropTableExceptList());
initializer.setDropSequenceExceptList(_replaceSchemaProperties.getDropSequenceExceptList());
initializer.setDropProcedureExceptList(_replaceSchemaProperties.getDropProcedureExceptList());
return;
}
if (_initializeType.equals(InitializeType.ADDTIONAL)) {
// Here 'Additional'!
if (_additionalDropMap == null) {
String msg = "The additional drop map should exist if the initialize type is additional!";
throw new IllegalStateException(msg);
}
initializer.setDataSource(getAdditionalDataSource());
final UnifiedSchema unifiedSchema = getAdditionalDropSchema(_additionalDropMap);
initializer.setUnifiedSchema(unifiedSchema);
initializer.setDropObjectTypeList(getAdditionalDropObjectTypeList(_additionalDropMap));
initializer.setSuppressConnectionFailure(isSuppressAdditionalDropSchemaConnectionFailure(_additionalDropMap));
// initializer.setDropProcedureExceptList(null);
return;
}
String msg = "Unknown initialize type: " + _initializeType;
throw new IllegalStateException(msg);
}
use of org.apache.torque.engine.database.model.UnifiedSchema in project dbflute-core by dbflute.
the class DfLoadDataProcess method createAsCore.
public static DfLoadDataProcess createAsCore(String sqlRootDir, DataSource dataSource, boolean previous) {
final UnifiedSchema mainSchema = getDatabaseProperties().getDatabaseSchema();
final DfLoadDataProcess process = new DfLoadDataProcess(sqlRootDir, dataSource, mainSchema);
if (previous) {
process.suppressCheckColumnDef();
process.suppressCheckImplicitSet();
}
return process;
}
use of org.apache.torque.engine.database.model.UnifiedSchema in project dbflute-core by dbflute.
the class DfRepsSequenceHandlerJdbc method initializeTableInfo.
protected void initializeTableInfo(Connection conn) throws SQLException {
if (_tableMap != null) {
return;
}
_tableMap = StringKeyMap.createAsFlexible();
final DfTableExtractor tableHandler = new DfTableExtractor();
final DatabaseMetaData metaData = conn.getMetaData();
final List<UnifiedSchema> unifiedSchemaList = _unifiedSchemaList;
for (UnifiedSchema unifiedSchema : unifiedSchemaList) {
// same-name tables between different schemas are unsupported
// so put all directly here
_tableMap.putAll(tableHandler.getTableMap(metaData, unifiedSchema));
}
}
use of org.apache.torque.engine.database.model.UnifiedSchema in project dbflute-core by dbflute.
the class DfColumnExtractor method getColumnList.
// ===================================================================================
// Meta Getting
// ============
/**
* Get the list of column meta information.
* @param metaData The meta data of database. (NotNull)
* @param tableInfo The meta information of table. (NotNull)
* @return The list of column meta information. (NotNull)
*/
public List<DfColumnMeta> getColumnList(DatabaseMetaData metaData, DfTableMeta tableInfo) throws SQLException {
final UnifiedSchema unifiedSchema = tableInfo.getUnifiedSchema();
final String tableName = tableInfo.getTableName();
return getColumnList(metaData, unifiedSchema, tableName);
}
use of org.apache.torque.engine.database.model.UnifiedSchema in project dbflute-core by dbflute.
the class DfSynonymExtractorOracle method buildSynonymSelect.
protected String buildSynonymSelect() {
final StringBuilder sb = new StringBuilder();
int count = 0;
for (UnifiedSchema unifiedSchema : _unifiedSchemaList) {
if (count > 0) {
sb.append(", ");
}
sb.append("'").append(unifiedSchema.getPureSchema()).append("'");
++count;
}
final String sql = "select * from ALL_SYNONYMS where OWNER in (" + sb.toString() + ")";
return sql;
}
Aggregations