use of org.jkiss.dbeaver.model.impl.sql.edit.SQLObjectEditor in project dbeaver by serge-rider.
the class JDBCUtils method generateTableDDL.
public static String generateTableDDL(@NotNull DBRProgressMonitor monitor, @NotNull JDBCTable table, boolean addComments) throws DBException {
final DBERegistry editorsRegistry = table.getDataSource().getContainer().getPlatform().getEditorsRegistry();
final SQLObjectEditor entityEditor = editorsRegistry.getObjectManager(table.getClass(), SQLObjectEditor.class);
if (entityEditor instanceof SQLTableManager) {
DBEPersistAction[] ddlActions = ((SQLTableManager) entityEditor).getTableDDL(monitor, table);
return SQLUtils.generateScript(table.getDataSource(), ddlActions, addComments);
}
log.debug("Table editor not found for " + table.getClass().getName());
return SQLUtils.generateCommentLine(table.getDataSource(), "Can't generate DDL: table editor not found for " + table.getClass().getName());
}
Aggregations