Search in sources :

Example 1 with OracleView

use of org.jkiss.dbeaver.ext.oracle.model.OracleView in project dbeaver by serge-rider.

the class OracleViewManager method createOrReplaceViewQuery.

private void createOrReplaceViewQuery(List<DBEPersistAction> actions, DBECommandComposite<OracleView, PropertyHandler> command) {
    final OracleView view = command.getObject();
    boolean hasComment = command.getProperty("comment") != null;
    if (!hasComment || command.getProperties().size() > 1) {
        actions.add(new SQLDatabasePersistAction("Create view", view.getAdditionalInfo().getText()));
    }
    if (hasComment) {
        actions.add(new SQLDatabasePersistAction("Comment table", "COMMENT ON TABLE " + view.getFullyQualifiedName(DBPEvaluationContext.DDL) + " IS '" + view.getComment() + "'"));
    }
}
Also used : OracleView(org.jkiss.dbeaver.ext.oracle.model.OracleView) SQLDatabasePersistAction(org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction)

Example 2 with OracleView

use of org.jkiss.dbeaver.ext.oracle.model.OracleView in project dbeaver by serge-rider.

the class OracleViewManager method createDatabaseObject.

@Override
protected OracleView createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, OracleSchema parent, Object copyFrom) {
    //$NON-NLS-1$
    OracleView newView = new OracleView(parent, "NEW_VIEW");
    newView.getAdditionalInfo().setText("CREATE OR REPLACE VIEW " + newView.getFullyQualifiedName(DBPEvaluationContext.DDL) + " AS\nSELECT");
    return newView;
}
Also used : OracleView(org.jkiss.dbeaver.ext.oracle.model.OracleView)

Aggregations

OracleView (org.jkiss.dbeaver.ext.oracle.model.OracleView)2 SQLDatabasePersistAction (org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction)1