use of org.dbflute.logic.jdbc.metadata.comment.DfDbCommentExtractorOracle in project dbflute-core by dbflute.
the class DfSynonymExtractorOracle method setupTableColumnComment.
/**
* Set up table and column comment. <br>
* This does not support DB link synonym.
* @param synonymMap The map of synonym. (NotNull)
*/
protected void setupTableColumnComment(Map<String, DfSynonymMeta> synonymMap) {
final Map<UnifiedSchema, Set<String>> ownerTabSetMap = createOwnerTableSetMap(synonymMap);
final Map<UnifiedSchema, Map<String, UserTabComments>> ownerTabCommentMap = newLinkedHashMap();
final Map<UnifiedSchema, Map<String, Map<String, UserColComments>>> ownerTabColCommentMap = newLinkedHashMap();
for (UnifiedSchema owner : ownerTabSetMap.keySet()) {
final Set<String> tableSet = ownerTabSetMap.get(owner);
final DfDbCommentExtractorOracle extractor = createDbCommentExtractor(owner);
final Map<String, UserTabComments> tabCommentMap = extractor.extractTableComment(tableSet);
final Map<String, Map<String, UserColComments>> tabColCommentMap = extractor.extractColumnComment(tableSet);
ownerTabCommentMap.put(owner, tabCommentMap);
ownerTabColCommentMap.put(owner, tabColCommentMap);
}
for (DfSynonymMeta synonym : synonymMap.values()) {
final UnifiedSchema owner = synonym.getTableOwner();
final String tableName = synonym.getTableName();
final Map<String, UserTabComments> tableCommentMap = ownerTabCommentMap.get(owner);
if (tableCommentMap != null) {
final UserTabComments userTabComments = tableCommentMap.get(tableName);
if (userTabComments != null && userTabComments.hasComments()) {
synonym.setTableComment(userTabComments.getComments());
}
}
final Map<String, Map<String, UserColComments>> tabColCommentMap = ownerTabColCommentMap.get(owner);
if (tabColCommentMap != null) {
final Map<String, UserColComments> colCommentMap = tabColCommentMap.get(tableName);
if (colCommentMap != null && !colCommentMap.isEmpty()) {
synonym.setColumnCommentMap(colCommentMap);
}
}
}
}
use of org.dbflute.logic.jdbc.metadata.comment.DfDbCommentExtractorOracle in project dbflute-core by dbflute.
the class DfDbCommentExtractorFactory method createDbCommentExtractor.
// ===================================================================================
// Create
// ======
/**
* @return The extractor of DB comments. (NullAllowed)
*/
public DfDbCommentExtractor createDbCommentExtractor() {
if (_databaseTypeFacadeProp.isDatabaseMySQL()) {
final DfDbCommentExtractorMySQL extractor = new DfDbCommentExtractorMySQL();
extractor.setDataSource(_dataSource);
extractor.setUnifiedSchema(_unifiedSchema);
return extractor;
} else if (_databaseTypeFacadeProp.isDatabaseOracle()) {
final DfDbCommentExtractorOracle extractor = new DfDbCommentExtractorOracle();
extractor.setDataSource(_dataSource);
extractor.setUnifiedSchema(_unifiedSchema);
return extractor;
} else if (_databaseTypeFacadeProp.isDatabaseSQLServer()) {
final DfDbCommentExtractorSQLServer extractor = new DfDbCommentExtractorSQLServer();
extractor.setDataSource(_dataSource);
extractor.setUnifiedSchema(_unifiedSchema);
return extractor;
}
return null;
}
use of org.dbflute.logic.jdbc.metadata.comment.DfDbCommentExtractorOracle in project dbflute-core by dbflute.
the class DfSynonymExtractorOracle method createDbCommentExtractor.
protected DfDbCommentExtractorOracle createDbCommentExtractor(UnifiedSchema schema) {
final DfDbCommentExtractorOracle extractor = new DfDbCommentExtractorOracle();
extractor.setDataSource(_dataSource);
extractor.setUnifiedSchema(schema);
return extractor;
}
Aggregations