use of org.jkiss.dbeaver.ext.exasol.model.ExasolView in project dbeaver by serge-rider.
the class ExasolViewManager method addObjectDeleteActions.
@Override
protected void addObjectDeleteActions(DBRProgressMonitor monitor, DBCExecutionContext executionContext, List<DBEPersistAction> actions, ObjectDeleteCommand command, Map<String, Object> options) {
ExasolView view = command.getObject();
actions.add(new SQLDatabasePersistAction("Drop view", "DROP VIEW " + view.getFullyQualifiedName(DBPEvaluationContext.DDL)));
}
use of org.jkiss.dbeaver.ext.exasol.model.ExasolView in project dbeaver by serge-rider.
the class ExasolExportTableTool method execute.
@Override
public void execute(IWorkbenchWindow window, IWorkbenchPart activePart, Collection<DBSObject> objects) throws DBException {
List<ExasolTable> tables = CommonUtils.filterCollection(objects, ExasolTable.class);
List<ExasolView> views = CommonUtils.filterCollection(objects, ExasolView.class);
List<ExasolSchema> schemas = CommonUtils.filterCollection(objects, ExasolSchema.class);
// add tables for all Schemas but ignore views in schema
for (ExasolSchema schema : schemas) {
tables.addAll(schema.getTables(new VoidProgressMonitor()));
}
// create TableBase Objects list
@SuppressWarnings({ "unchecked", "rawtypes" }) HashSet<ExasolTableBase> tableBaseObjects = new HashSet();
// add tables
for (ExasolTable table : tables) {
tableBaseObjects.add((ExasolTableBase) table);
}
// add views
for (ExasolView view : views) {
tableBaseObjects.add((ExasolTableBase) view);
}
if (!tableBaseObjects.isEmpty()) {
ExasolExportTableToolDialog dialog = new ExasolExportTableToolDialog(activePart.getSite(), tableBaseObjects);
dialog.open();
}
}
use of org.jkiss.dbeaver.ext.exasol.model.ExasolView in project dbeaver by dbeaver.
the class ExasolExportTableTool method execute.
@Override
public void execute(IWorkbenchWindow window, IWorkbenchPart activePart, Collection<DBSObject> objects) throws DBException {
List<ExasolTable> tables = CommonUtils.filterCollection(objects, ExasolTable.class);
List<ExasolView> views = CommonUtils.filterCollection(objects, ExasolView.class);
List<ExasolSchema> schemas = CommonUtils.filterCollection(objects, ExasolSchema.class);
// add tables for all Schemas but ignore views in schema
for (ExasolSchema schema : schemas) {
tables.addAll(schema.getTables(new VoidProgressMonitor()));
}
// create TableBase Objects list
@SuppressWarnings({ "unchecked", "rawtypes" }) HashSet<ExasolTableBase> tableBaseObjects = new HashSet();
// add tables
for (ExasolTable table : tables) {
tableBaseObjects.add((ExasolTableBase) table);
}
// add views
for (ExasolView view : views) {
tableBaseObjects.add((ExasolTableBase) view);
}
if (!tableBaseObjects.isEmpty()) {
ExasolExportTableToolDialog dialog = new ExasolExportTableToolDialog(activePart.getSite(), tableBaseObjects);
dialog.open();
}
}
use of org.jkiss.dbeaver.ext.exasol.model.ExasolView in project dbeaver by dbeaver.
the class ExasolViewManager method createDatabaseObject.
@Override
protected ExasolView createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, Object container, Object copyFrom, Map<String, Object> options) throws DBException {
ExasolSchema schema = (ExasolSchema) container;
ExasolView newView = new ExasolView(schema);
newView.setName("new_view");
setNewObjectName(monitor, schema, newView);
newView.setObjectDefinitionText("CREATE OR REPLACE VIEW " + newView.getFullyQualifiedName(DBPEvaluationContext.DDL) + " AS\nSELECT");
return newView;
}
use of org.jkiss.dbeaver.ext.exasol.model.ExasolView in project dbeaver by dbeaver.
the class ExasolViewManager method addObjectDeleteActions.
@Override
protected void addObjectDeleteActions(DBRProgressMonitor monitor, DBCExecutionContext executionContext, List<DBEPersistAction> actions, ObjectDeleteCommand command, Map<String, Object> options) {
ExasolView view = command.getObject();
actions.add(new SQLDatabasePersistAction("Drop view", "DROP VIEW " + view.getFullyQualifiedName(DBPEvaluationContext.DDL)));
}
Aggregations