use of org.dbflute.logic.jdbc.metadata.info.DfTableMeta in project dbflute-core by dbflute.
the class DfSchemaXmlSerializer method resolveAdditionalSchema.
protected void resolveAdditionalSchema(DatabaseMetaData dbMeta, List<DfTableMeta> tableList) throws SQLException {
if (_suppressAdditionalSchema) {
return;
}
final List<UnifiedSchema> schemaList = getDatabaseProperties().getAdditionalSchemaList();
for (UnifiedSchema additionalSchema : schemaList) {
final List<DfTableMeta> additionalTableList = _tableExtractor.getTableList(dbMeta, additionalSchema);
helpTableBasicSupplement(additionalTableList, additionalSchema);
tableList.addAll(additionalTableList);
}
}
use of org.dbflute.logic.jdbc.metadata.info.DfTableMeta in project dbflute-core by dbflute.
the class DfSchemaXmlSerializer method getTableList.
// ===================================================================================
// Meta Data Handler
// =================
// -----------------------------------------------------
// Table
// -----
/**
* Get the list of table meta in the current database that are not system tables.
* @param dbMeta The meta data of a database. (NotNull)
* @return The list of all the tables in a database. (NotNull)
* @throws SQLException When it fails to handle the SQL.
*/
public List<DfTableMeta> getTableList(DatabaseMetaData dbMeta) throws SQLException {
final UnifiedSchema mainSchema = _dataSource.getSchema();
final List<DfTableMeta> tableList = _tableExtractor.getTableList(dbMeta, mainSchema);
helpTableBasicSupplement(tableList, mainSchema);
resolveAdditionalSchema(dbMeta, tableList);
assertDuplicateTable(tableList);
// table names from meta data are used so basically it does not need it
// but it prepares here just in case
prepareTableCaseTranslation(tableList);
return tableList;
}
use of org.dbflute.logic.jdbc.metadata.info.DfTableMeta in project dbflute-core by dbflute.
the class DfSchemaXmlSerializer method prepareTableCaseTranslation.
protected void prepareTableCaseTranslation(List<DfTableMeta> tableList) {
final List<String> tableNameList = new ArrayList<String>();
for (DfTableMeta meta : tableList) {
tableNameList.add(meta.getTableDbName());
}
_columnExtractor.enableTableCaseTranslation(tableNameList);
_uniqueKeyExtractor.enableTableCaseTranslation(tableNameList);
_indexExtractor.enableTableCaseTranslation(tableNameList);
_foreignKeyExtractor.enableTableCaseTranslation(tableNameList);
}
use of org.dbflute.logic.jdbc.metadata.info.DfTableMeta in project dbflute-core by dbflute.
the class DfSynonymExtractorOracle method isForeignTableGenerated.
protected boolean isForeignTableGenerated(UnifiedSchema tableOwner, String foreignTableName) {
if (_generatedTableMap == null || _generatedTableMap.isEmpty()) {
// means no check of generation
return true;
}
final DfTableMeta info = _generatedTableMap.get(foreignTableName);
if (info == null) {
return false;
}
final UnifiedSchema unifiedSchema = info.getUnifiedSchema();
if (!unifiedSchema.getPureSchema().equals(tableOwner.getPureSchema())) {
// (tables in same schema are target here)
return false;
}
if (info.isOutOfGenerateTarget()) {
return false;
}
return true;
}
use of org.dbflute.logic.jdbc.metadata.info.DfTableMeta in project dbflute-core by dbflute.
the class DfSchemaXmlSerializer method processTable.
// -----------------------------------------------------
// Table
// -----
protected void processTable(final Connection conn, final DatabaseMetaData metaData, final List<DfTableMeta> tableList) throws SQLException {
_log.info("");
_log.info("$ /= = = = = = = = = = = = = = = = = = = = = = = = = =");
_log.info("$ [Table List]");
final int runnerCount = getMetaDataCountDownRaceRunnerCount();
if (runnerCount > 1 && _dataSource.getDataSource() instanceof DfFittingDataSource) {
countDownRaceProcessTable(tableList, runnerCount, (DfFittingDataSource) _dataSource.getDataSource());
} else {
for (DfTableMeta tableMeta : tableList) {
doProcessTable(conn, metaData, tableMeta);
}
}
for (Element element : _tableElementStagingMap.values()) {
_databaseNode.appendChild(element);
}
_log.info("$ ");
_log.info("$ [Table Count]");
_log.info("$ " + _tableElementStagingMap.size());
_log.info("$ = = = = = = = = = =/");
_log.info("");
}
Aggregations