Search in sources :

Example 11 with ExasolTableBase

use of org.jkiss.dbeaver.ext.exasol.model.ExasolTableBase 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();
    }
}
Also used : ExasolSchema(org.jkiss.dbeaver.ext.exasol.model.ExasolSchema) ExasolView(org.jkiss.dbeaver.ext.exasol.model.ExasolView) ExasolTableBase(org.jkiss.dbeaver.ext.exasol.model.ExasolTableBase) VoidProgressMonitor(org.jkiss.dbeaver.model.runtime.VoidProgressMonitor) ExasolTable(org.jkiss.dbeaver.ext.exasol.model.ExasolTable) HashSet(java.util.HashSet)

Example 12 with ExasolTableBase

use of org.jkiss.dbeaver.ext.exasol.model.ExasolTableBase in project dbeaver by dbeaver.

the class ExasolImportTableTool method execute.

@Override
public void execute(IWorkbenchWindow window, IWorkbenchPart activePart, Collection<DBSObject> objects) throws DBException {
    List<ExasolTable> tables = CommonUtils.filterCollection(objects, ExasolTable.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);
    }
    if (!tableBaseObjects.isEmpty()) {
        ExasolImportTableToolDialog dialog = new ExasolImportTableToolDialog(activePart.getSite(), tableBaseObjects);
        dialog.open();
    }
}
Also used : ExasolSchema(org.jkiss.dbeaver.ext.exasol.model.ExasolSchema) ExasolTableBase(org.jkiss.dbeaver.ext.exasol.model.ExasolTableBase) VoidProgressMonitor(org.jkiss.dbeaver.model.runtime.VoidProgressMonitor) ExasolTable(org.jkiss.dbeaver.ext.exasol.model.ExasolTable) HashSet(java.util.HashSet)

Example 13 with ExasolTableBase

use of org.jkiss.dbeaver.ext.exasol.model.ExasolTableBase in project dbeaver by serge-rider.

the class ExasolTableColumnManager method createDatabaseObject.

// ------
// Create
// ------
@Override
protected ExasolTableColumn createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, Object container, Object copyFrom, Map<String, Object> options) {
    ExasolTableColumn column = new ExasolTableColumn((ExasolTableBase) container);
    column.setName(getNewColumnName(monitor, context, (ExasolTableBase) container));
    return column;
}
Also used : ExasolTableBase(org.jkiss.dbeaver.ext.exasol.model.ExasolTableBase) ExasolTableColumn(org.jkiss.dbeaver.ext.exasol.model.ExasolTableColumn)

Aggregations

ExasolTableBase (org.jkiss.dbeaver.ext.exasol.model.ExasolTableBase)13 HashSet (java.util.HashSet)6 ExasolSchema (org.jkiss.dbeaver.ext.exasol.model.ExasolSchema)6 ExasolTable (org.jkiss.dbeaver.ext.exasol.model.ExasolTable)6 VoidProgressMonitor (org.jkiss.dbeaver.model.runtime.VoidProgressMonitor)4 Statement (java.sql.Statement)3 IJobChangeEvent (org.eclipse.core.runtime.jobs.IJobChangeEvent)3 JobChangeAdapter (org.eclipse.core.runtime.jobs.JobChangeAdapter)3 Font (org.eclipse.swt.graphics.Font)3 Tree (org.eclipse.swt.widgets.Tree)3 TreeColumn (org.eclipse.swt.widgets.TreeColumn)3 TreeItem (org.eclipse.swt.widgets.TreeItem)3 NotNull (org.jkiss.code.NotNull)3 Nullable (org.jkiss.code.Nullable)3 ExasolView (org.jkiss.dbeaver.ext.exasol.model.ExasolView)3 JDBCSession (org.jkiss.dbeaver.model.exec.jdbc.JDBCSession)3 LocalResultSet (org.jkiss.dbeaver.model.impl.local.LocalResultSet)3 DBRProgressMonitor (org.jkiss.dbeaver.model.runtime.DBRProgressMonitor)3 DataSourceJob (org.jkiss.dbeaver.runtime.jobs.DataSourceJob)3 SQLScriptStatusDialog (org.jkiss.dbeaver.ui.dialogs.sql.SQLScriptStatusDialog)2