use of org.dbflute.logic.jdbc.metadata.comment.DfDbCommentExtractor in project dbflute-core by dbflute.
the class DfSchemaXmlSerializer method doHelpTableComment.
protected void doHelpTableComment(List<DfTableMeta> tableList, UnifiedSchema unifiedSchema) {
final DfDbCommentExtractor dbCommentExtractor = createDbCommentExtractor(unifiedSchema);
if (dbCommentExtractor != null) {
final Set<String> tableSet = new HashSet<String>();
for (DfTableMeta table : tableList) {
tableSet.add(table.getTableName());
}
try {
final Map<String, UserTabComments> tableCommentMap = dbCommentExtractor.extractTableComment(tableSet);
for (DfTableMeta table : tableList) {
table.acceptTableComment(tableCommentMap);
// *Synonym Processing is after loading synonyms.
}
} catch (RuntimeException ignored) {
_log.info("Failed to extract table comments: extractor=" + dbCommentExtractor, ignored);
}
try {
if (_columnCommentAllMap == null) {
_columnCommentAllMap = new LinkedHashMap<UnifiedSchema, Map<String, Map<String, UserColComments>>>();
}
final Map<String, Map<String, UserColComments>> columnCommentMap = _columnCommentAllMap.get(unifiedSchema);
final Map<String, Map<String, UserColComments>> extractedMap = dbCommentExtractor.extractColumnComment(tableSet);
if (columnCommentMap == null) {
_columnCommentAllMap.put(unifiedSchema, extractedMap);
} else {
// basically no way, schema is unique but just in case
// merge
columnCommentMap.putAll(extractedMap);
}
} catch (RuntimeException continued) {
_log.info("Failed to extract column comments: extractor=" + dbCommentExtractor, continued);
}
}
}
Aggregations