use of org.jkiss.dbeaver.ext.oracle.model.OracleTableBase in project dbeaver by serge-rider.
the class OracleSourceDeclarationEditor method contributeEditorCommands.
@Override
protected void contributeEditorCommands(IContributionManager toolBarManager) {
super.contributeEditorCommands(toolBarManager);
if (getSourceObject() instanceof OracleTableBase) {
OracleTableBase sourceObject = (OracleTableBase) getSourceObject();
OracleEditorUtils.addDDLControl(toolBarManager, sourceObject, this);
}
}
use of org.jkiss.dbeaver.ext.oracle.model.OracleTableBase in project dbeaver by serge-rider.
the class OracleTableColumnManager method createDatabaseObject.
@Override
protected OracleTableColumn createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, Object container, Object copyFrom, Map<String, Object> options) {
OracleTableBase table = (OracleTableBase) container;
// $NON-NLS-1$
DBSDataType columnType = findBestDataType(table.getDataSource(), "varchar2");
final OracleTableColumn column = new OracleTableColumn(table);
column.setName(getNewColumnName(monitor, context, table));
column.setDataType((OracleDataType) columnType);
// $NON-NLS-1$
column.setTypeName(columnType == null ? "INTEGER" : columnType.getName());
column.setMaxLength(columnType != null && columnType.getDataKind() == DBPDataKind.STRING ? 100 : 0);
column.setValueType(columnType == null ? Types.INTEGER : columnType.getTypeID());
column.setOrdinalPosition(-1);
return column;
}
use of org.jkiss.dbeaver.ext.oracle.model.OracleTableBase in project dbeaver by serge-rider.
the class OracleConstraintManager method addObjectCreateActions.
@Override
protected void addObjectCreateActions(DBRProgressMonitor monitor, DBCExecutionContext executionContext, List<DBEPersistAction> actions, ObjectCreateCommand command, Map<String, Object> options) {
OracleTableConstraint constraint = command.getObject();
boolean isView = constraint.getTable().isView();
String tableType = isView ? "VIEW" : "TABLE";
OracleTableBase table = constraint.getTable();
actions.add(new SQLDatabasePersistAction(ModelMessages.model_jdbc_create_new_constraint, "ALTER " + tableType + " " + table.getFullyQualifiedName(DBPEvaluationContext.DDL) + "\nADD " + getNestedDeclaration(monitor, table, command, options) + "\n" + (!isView && constraint.getStatus() == OracleObjectStatus.ENABLED ? "ENABLE" : "DISABLE") + (isView ? " NOVALIDATE" : "")));
}
use of org.jkiss.dbeaver.ext.oracle.model.OracleTableBase in project dbeaver by dbeaver.
the class OracleTableColumnManager method createDatabaseObject.
@Override
protected OracleTableColumn createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, Object container, Object copyFrom, Map<String, Object> options) {
OracleTableBase table = (OracleTableBase) container;
// $NON-NLS-1$
DBSDataType columnType = findBestDataType(table.getDataSource(), "varchar2");
final OracleTableColumn column = new OracleTableColumn(table);
column.setName(getNewColumnName(monitor, context, table));
column.setDataType((OracleDataType) columnType);
// $NON-NLS-1$
column.setTypeName(columnType == null ? "INTEGER" : columnType.getName());
column.setMaxLength(columnType != null && columnType.getDataKind() == DBPDataKind.STRING ? 100 : 0);
column.setValueType(columnType == null ? Types.INTEGER : columnType.getTypeID());
column.setOrdinalPosition(-1);
return column;
}
use of org.jkiss.dbeaver.ext.oracle.model.OracleTableBase in project dbeaver by dbeaver.
the class OracleConstraintManager method addObjectCreateActions.
@Override
protected void addObjectCreateActions(DBRProgressMonitor monitor, DBCExecutionContext executionContext, List<DBEPersistAction> actions, ObjectCreateCommand command, Map<String, Object> options) {
OracleTableConstraint constraint = command.getObject();
boolean isView = constraint.getTable().isView();
String tableType = isView ? "VIEW" : "TABLE";
OracleTableBase table = constraint.getTable();
actions.add(new SQLDatabasePersistAction(ModelMessages.model_jdbc_create_new_constraint, "ALTER " + tableType + " " + table.getFullyQualifiedName(DBPEvaluationContext.DDL) + "\nADD " + getNestedDeclaration(monitor, table, command, options) + "\n" + (!isView && constraint.getStatus() == OracleObjectStatus.ENABLED ? "ENABLE" : "DISABLE") + (isView ? " NOVALIDATE" : "")));
}
Aggregations