Search in sources :

Example 1 with ExasolTable

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

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(VoidProgressMonitor.INSTANCE));
    }
    // 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) ExasolTable(org.jkiss.dbeaver.ext.exasol.model.ExasolTable) HashSet(java.util.HashSet)

Example 2 with ExasolTable

use of org.jkiss.dbeaver.ext.exasol.model.ExasolTable 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(VoidProgressMonitor.INSTANCE));
    }
    // 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) ExasolTable(org.jkiss.dbeaver.ext.exasol.model.ExasolTable) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)2 ExasolSchema (org.jkiss.dbeaver.ext.exasol.model.ExasolSchema)2 ExasolTable (org.jkiss.dbeaver.ext.exasol.model.ExasolTable)2 ExasolTableBase (org.jkiss.dbeaver.ext.exasol.model.ExasolTableBase)2 ExasolView (org.jkiss.dbeaver.ext.exasol.model.ExasolView)1