Search in sources :

Example 1 with DBSEntityAttribute

use of org.jkiss.dbeaver.model.struct.DBSEntityAttribute in project dbeaver by serge-rider.

the class JDBCTableConstraint method readKeyEnumeration.

private Collection<DBDLabelValuePair> readKeyEnumeration(DBCSession session, DBSEntityAttribute keyColumn, Object keyPattern, List<DBDAttributeValue> preceedingKeys, int maxResults) throws DBException {
    final TABLE table = getParentObject();
    assert table != null;
    DBDValueHandler keyValueHandler = DBUtils.findValueHandler(session, keyColumn);
    if (keyPattern != null) {
        if (keyPattern instanceof CharSequence) {
            if (((CharSequence) keyPattern).length() > 0) {
                keyPattern = "%" + keyPattern.toString() + "%";
            } else {
                keyPattern = null;
            }
        } else if (keyPattern instanceof Number) {
            // Subtract gap value to see some values before specified
            int gapSize = maxResults / 2;
            if (keyPattern instanceof Integer) {
                keyPattern = (Integer) keyPattern - gapSize;
            } else if (keyPattern instanceof Short) {
                keyPattern = (Short) keyPattern - gapSize;
            } else if (keyPattern instanceof Long) {
                keyPattern = (Long) keyPattern - gapSize;
            } else if (keyPattern instanceof Float) {
                keyPattern = (Float) keyPattern - gapSize;
            } else if (keyPattern instanceof Double) {
                keyPattern = (Double) keyPattern - gapSize;
            } else if (keyPattern instanceof BigInteger) {
                keyPattern = ((BigInteger) keyPattern).subtract(BigInteger.valueOf(gapSize));
            } else if (keyPattern instanceof BigDecimal) {
                keyPattern = ((BigDecimal) keyPattern).subtract(new BigDecimal(gapSize));
            }
        } else {
            // not supported
            keyPattern = null;
        }
    }
    StringBuilder query = new StringBuilder();
    query.append("SELECT ").append(DBUtils.getQuotedIdentifier(keyColumn));
    String descColumns = DBVUtils.getDictionaryDescriptionColumns(session.getProgressMonitor(), keyColumn);
    Collection<DBSEntityAttribute> descAttributes = null;
    if (descColumns != null) {
        descAttributes = DBVEntity.getDescriptionColumns(session.getProgressMonitor(), table, descColumns);
        query.append(", ").append(descColumns);
    }
    query.append(" FROM ").append(DBUtils.getObjectFullName(table, DBPEvaluationContext.DML));
    if (!CommonUtils.isEmpty(preceedingKeys) || keyPattern != null) {
        query.append(" WHERE ");
    }
    boolean hasCond = false;
    // Preceeding keys
    if (preceedingKeys != null && !preceedingKeys.isEmpty()) {
        for (int i = 0; i < preceedingKeys.size(); i++) {
            if (hasCond)
                query.append(" AND ");
            query.append(DBUtils.getQuotedIdentifier(getDataSource(), preceedingKeys.get(i).getAttribute().getName())).append(" = ?");
            hasCond = true;
        }
    }
    if (keyPattern != null) {
        if (hasCond)
            query.append(" AND (");
        query.append(DBUtils.getQuotedIdentifier(keyColumn));
        if (keyPattern instanceof CharSequence) {
            query.append(" LIKE ?");
        } else {
            query.append(" >= ?");
        }
        // Add desc columns conditions
        if (keyPattern instanceof CharSequence && descAttributes != null) {
            for (DBSEntityAttribute descAttr : descAttributes) {
                if (descAttr.getDataKind() == DBPDataKind.STRING) {
                    query.append(" OR ").append(DBUtils.getQuotedIdentifier(descAttr)).append(" LIKE ?");
                }
            }
        }
        if (hasCond)
            query.append(")");
        query.append(" ORDER BY ").append(DBUtils.getQuotedIdentifier(keyColumn));
    }
    try (DBCStatement dbStat = session.prepareStatement(DBCStatementType.QUERY, query.toString(), false, false, false)) {
        int paramPos = 0;
        if (preceedingKeys != null && !preceedingKeys.isEmpty()) {
            for (DBDAttributeValue precAttribute : preceedingKeys) {
                DBDValueHandler precValueHandler = DBUtils.findValueHandler(session, precAttribute.getAttribute());
                precValueHandler.bindValueObject(session, dbStat, precAttribute.getAttribute(), paramPos++, precAttribute.getValue());
            }
        }
        if (keyPattern != null) {
            keyValueHandler.bindValueObject(session, dbStat, keyColumn, paramPos++, keyPattern);
        }
        if (keyPattern instanceof CharSequence && descAttributes != null) {
            for (DBSEntityAttribute descAttr : descAttributes) {
                if (descAttr.getDataKind() == DBPDataKind.STRING) {
                    final DBDValueHandler valueHandler = DBUtils.findValueHandler(session, descAttr);
                    valueHandler.bindValueObject(session, dbStat, keyColumn, paramPos++, keyPattern);
                }
            }
        }
        dbStat.setLimit(0, maxResults);
        if (dbStat.executeStatement()) {
            try (DBCResultSet dbResult = dbStat.openResultSet()) {
                return DBVUtils.readDictionaryRows(session, keyColumn, keyValueHandler, dbResult);
            }
        } else {
            return Collections.emptyList();
        }
    }
}
Also used : DBDAttributeValue(org.jkiss.dbeaver.model.data.DBDAttributeValue) DBDValueHandler(org.jkiss.dbeaver.model.data.DBDValueHandler) DBCStatement(org.jkiss.dbeaver.model.exec.DBCStatement) BigDecimal(java.math.BigDecimal) DBSEntityConstraint(org.jkiss.dbeaver.model.struct.DBSEntityConstraint) AbstractTableConstraint(org.jkiss.dbeaver.model.impl.struct.AbstractTableConstraint) BigInteger(java.math.BigInteger) DBSEntityAttribute(org.jkiss.dbeaver.model.struct.DBSEntityAttribute) BigInteger(java.math.BigInteger) DBCResultSet(org.jkiss.dbeaver.model.exec.DBCResultSet)

Example 2 with DBSEntityAttribute

use of org.jkiss.dbeaver.model.struct.DBSEntityAttribute in project dbeaver by serge-rider.

the class ColumnsMappingDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    DBPDataSource targetDataSource = settings.getTargetDataSource(mapping);
    getShell().setText("Map columns of " + mapping.getTargetName());
    boldFont = UIUtils.makeBoldFont(parent.getFont());
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(1, false));
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    new Label(composite, SWT.NONE).setText("Source entity: " + DBUtils.getObjectFullName(mapping.getSource(), DBPEvaluationContext.UI) + " [" + mapping.getSource().getDataSource().getContainer().getName() + "]");
    new Label(composite, SWT.NONE).setText("Target entity: " + mapping.getTargetName() + " [" + (targetDataSource == null ? "?" : targetDataSource.getContainer().getName()) + "]");
    mappingViewer = new TableViewer(composite, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.widthHint = 600;
    gd.heightHint = 300;
    mappingViewer.getTable().setLayoutData(gd);
    mappingViewer.getTable().setLinesVisible(true);
    mappingViewer.getTable().setHeaderVisible(true);
    mappingViewer.setContentProvider(new ListContentProvider());
    mappingViewer.getTable().addKeyListener(new KeyAdapter() {

        @Override
        public void keyReleased(KeyEvent e) {
            if (e.character == SWT.DEL) {
                for (TableItem item : mappingViewer.getTable().getSelection()) {
                    DatabaseMappingAttribute attribute = (DatabaseMappingAttribute) item.getData();
                    attribute.setMappingType(DatabaseMappingType.skip);
                }
                updateStatus(Status.OK_STATUS);
                mappingViewer.refresh();
            } else if (e.character == SWT.SPACE) {
                for (TableItem item : mappingViewer.getTable().getSelection()) {
                    DatabaseMappingAttribute attribute = (DatabaseMappingAttribute) item.getData();
                    attribute.setMappingType(DatabaseMappingType.existing);
                    try {
                        attribute.updateMappingType(VoidProgressMonitor.INSTANCE);
                    } catch (DBException e1) {
                        updateStatus(GeneralUtils.makeExceptionStatus(e1));
                    }
                }
                mappingViewer.refresh();
            }
        }
    });
    {
        TableViewerColumn columnSource = new TableViewerColumn(mappingViewer, SWT.LEFT);
        columnSource.setLabelProvider(new CellLabelProvider() {

            @Override
            public void update(ViewerCell cell) {
                DatabaseMappingAttribute attrMapping = (DatabaseMappingAttribute) cell.getElement();
                cell.setText(DBUtils.getObjectFullName(attrMapping.getSource(), DBPEvaluationContext.UI));
                if (attrMapping.getIcon() != null) {
                    cell.setImage(DBeaverIcons.getImage(attrMapping.getIcon()));
                }
            }
        });
        columnSource.getColumn().setText("Source Column");
        columnSource.getColumn().setWidth(170);
    }
    {
        TableViewerColumn columnSourceType = new TableViewerColumn(mappingViewer, SWT.LEFT);
        columnSourceType.setLabelProvider(new CellLabelProvider() {

            @Override
            public void update(ViewerCell cell) {
                cell.setText(((DatabaseMappingAttribute) cell.getElement()).getSourceType());
            }
        });
        columnSourceType.getColumn().setText("Source Type");
        columnSourceType.getColumn().setWidth(100);
    }
    {
        TableViewerColumn columnTarget = new TableViewerColumn(mappingViewer, SWT.LEFT);
        columnTarget.setLabelProvider(new CellLabelProvider() {

            @Override
            public void update(ViewerCell cell) {
                DatabaseMappingAttribute mapping = (DatabaseMappingAttribute) cell.getElement();
                cell.setText(mapping.getTargetName());
                if (mapping.mappingType == DatabaseMappingType.unspecified) {
                    cell.setBackground(DBeaverUI.getSharedTextColors().getColor(SharedTextColors.COLOR_WARNING));
                } else {
                    cell.setBackground(null);
                }
                cell.setFont(boldFont);
            }
        });
        columnTarget.getColumn().setText("Target Column");
        columnTarget.getColumn().setWidth(170);
        columnTarget.setEditingSupport(new EditingSupport(mappingViewer) {

            @Override
            protected CellEditor getCellEditor(Object element) {
                try {
                    java.util.List<String> items = new ArrayList<>();
                    DatabaseMappingAttribute mapping = (DatabaseMappingAttribute) element;
                    if (mapping.getParent().getMappingType() == DatabaseMappingType.existing && mapping.getParent().getTarget() instanceof DBSEntity) {
                        DBSEntity parentEntity = (DBSEntity) mapping.getParent().getTarget();
                        for (DBSEntityAttribute attr : CommonUtils.safeCollection(parentEntity.getAttributes(VoidProgressMonitor.INSTANCE))) {
                            items.add(attr.getName());
                        }
                    }
                    items.add(DatabaseMappingAttribute.TARGET_NAME_SKIP);
                    CustomComboBoxCellEditor editor = new CustomComboBoxCellEditor(mappingViewer.getTable(), items.toArray(new String[items.size()]), SWT.DROP_DOWN);
                    updateStatus(Status.OK_STATUS);
                    return editor;
                } catch (DBException e) {
                    updateStatus(GeneralUtils.makeExceptionStatus(e));
                    return null;
                }
            }

            @Override
            protected boolean canEdit(Object element) {
                return true;
            }

            @Override
            protected Object getValue(Object element) {
                return ((DatabaseMappingAttribute) element).getTargetName();
            }

            @Override
            protected void setValue(Object element, Object value) {
                try {
                    String name = CommonUtils.toString(value);
                    DatabaseMappingAttribute attrMapping = (DatabaseMappingAttribute) element;
                    if (DatabaseMappingAttribute.TARGET_NAME_SKIP.equals(name)) {
                        attrMapping.setMappingType(DatabaseMappingType.skip);
                    } else {
                        if (attrMapping.getParent().getMappingType() == DatabaseMappingType.existing && attrMapping.getParent().getTarget() instanceof DBSEntity) {
                            DBSEntity parentEntity = (DBSEntity) attrMapping.getParent().getTarget();
                            for (DBSEntityAttribute attr : CommonUtils.safeCollection(parentEntity.getAttributes(VoidProgressMonitor.INSTANCE))) {
                                if (name.equalsIgnoreCase(attr.getName())) {
                                    attrMapping.setTarget(attr);
                                    attrMapping.setMappingType(DatabaseMappingType.existing);
                                    return;
                                }
                            }
                        }
                        attrMapping.setMappingType(DatabaseMappingType.create);
                        attrMapping.setTargetName(name);
                    }
                    updateStatus(Status.OK_STATUS);
                } catch (DBException e) {
                    updateStatus(GeneralUtils.makeExceptionStatus(e));
                } finally {
                    mappingViewer.refresh();
                }
            }
        });
    }
    {
        TableViewerColumn columnTargetType = new TableViewerColumn(mappingViewer, SWT.LEFT);
        columnTargetType.setLabelProvider(new CellLabelProvider() {

            @Override
            public void update(ViewerCell cell) {
                DatabaseMappingAttribute attrMapping = (DatabaseMappingAttribute) cell.getElement();
                DBPDataSource dataSource = settings.getTargetDataSource(attrMapping);
                cell.setText(attrMapping.getTargetType(dataSource));
                cell.setFont(boldFont);
            }
        });
        columnTargetType.getColumn().setText("Target Type");
        columnTargetType.getColumn().setWidth(100);
        columnTargetType.setEditingSupport(new EditingSupport(mappingViewer) {

            @Override
            protected CellEditor getCellEditor(Object element) {
                DatabaseMappingAttribute attrMapping = (DatabaseMappingAttribute) element;
                Set<String> types = new LinkedHashSet<>();
                DBPDataSource dataSource = settings.getTargetDataSource(attrMapping);
                if (dataSource instanceof DBPDataTypeProvider) {
                    for (DBSDataType type : ((DBPDataTypeProvider) dataSource).getLocalDataTypes()) {
                        types.add(type.getName());
                    }
                }
                types.add(attrMapping.getTargetType(dataSource));
                return new CustomComboBoxCellEditor(mappingViewer.getTable(), types.toArray(new String[types.size()]), SWT.BORDER);
            }

            @Override
            protected boolean canEdit(Object element) {
                return true;
            }

            @Override
            protected Object getValue(Object element) {
                DatabaseMappingAttribute attrMapping = (DatabaseMappingAttribute) element;
                return attrMapping.getTargetType(settings.getTargetDataSource(attrMapping));
            }

            @Override
            protected void setValue(Object element, Object value) {
                DatabaseMappingAttribute attrMapping = (DatabaseMappingAttribute) element;
                attrMapping.setTargetType(CommonUtils.toString(value));
                mappingViewer.refresh(element);
            }
        });
    }
    {
        TableViewerColumn columnType = new TableViewerColumn(mappingViewer, SWT.LEFT);
        columnType.setLabelProvider(new CellLabelProvider() {

            @Override
            public void update(ViewerCell cell) {
                DatabaseMappingAttribute mapping = (DatabaseMappingAttribute) cell.getElement();
                String text = "";
                switch(mapping.getMappingType()) {
                    case unspecified:
                        text = "?";
                        break;
                    case existing:
                        text = "existing";
                        break;
                    case create:
                        text = "new";
                        break;
                    case skip:
                        text = "skip";
                        break;
                }
                cell.setText(text);
            }
        });
        columnType.getColumn().setText("Mapping");
        columnType.getColumn().setWidth(60);
    }
    mappingViewer.setInput(attributeMappings);
    return parent;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) DBException(org.jkiss.dbeaver.DBException) KeyAdapter(org.eclipse.swt.events.KeyAdapter) TableItem(org.eclipse.swt.widgets.TableItem) Label(org.eclipse.swt.widgets.Label) ArrayList(java.util.ArrayList) CustomComboBoxCellEditor(org.jkiss.dbeaver.ui.controls.CustomComboBoxCellEditor) KeyEvent(org.eclipse.swt.events.KeyEvent) GridLayout(org.eclipse.swt.layout.GridLayout) ListContentProvider(org.jkiss.dbeaver.ui.controls.ListContentProvider) Composite(org.eclipse.swt.widgets.Composite) DBSDataType(org.jkiss.dbeaver.model.struct.DBSDataType) DBPDataSource(org.jkiss.dbeaver.model.DBPDataSource) DBSEntityAttribute(org.jkiss.dbeaver.model.struct.DBSEntityAttribute) GridData(org.eclipse.swt.layout.GridData) DBPDataTypeProvider(org.jkiss.dbeaver.model.DBPDataTypeProvider) DBSEntity(org.jkiss.dbeaver.model.struct.DBSEntity)

Example 3 with DBSEntityAttribute

use of org.jkiss.dbeaver.model.struct.DBSEntityAttribute in project dbeaver by serge-rider.

the class ValidateUniqueKeyUsageDialog method useAllColumns.

private static boolean useAllColumns(Shell shell, ResultSetViewer viewer) {
    // Use all columns
    final DBDRowIdentifier identifier = viewer.getVirtualEntityIdentifier();
    DBVEntityConstraint constraint = (DBVEntityConstraint) identifier.getUniqueKey();
    List<DBSEntityAttribute> uniqueColumns = new ArrayList<>();
    for (DBDAttributeBinding binding : viewer.getModel().getAttributes()) {
        if (binding.getEntityAttribute() != null) {
            uniqueColumns.add(binding.getEntityAttribute());
        }
    }
    if (uniqueColumns.isEmpty()) {
        UIUtils.showErrorDialog(shell, "Use All Columns", "No valid columns found for unique key");
        return false;
    }
    constraint.setAttributes(uniqueColumns);
    try {
        identifier.reloadAttributes(VoidProgressMonitor.INSTANCE, viewer.getModel().getAttributes());
    } catch (DBException e) {
        UIUtils.showErrorDialog(shell, "Use All Columns", "Can't reload unique columns", e);
        return false;
    }
    return true;
}
Also used : DBException(org.jkiss.dbeaver.DBException) DBSEntityAttribute(org.jkiss.dbeaver.model.struct.DBSEntityAttribute) ArrayList(java.util.ArrayList) DBVEntityConstraint(org.jkiss.dbeaver.model.virtual.DBVEntityConstraint) DBDAttributeBinding(org.jkiss.dbeaver.model.data.DBDAttributeBinding) DBDRowIdentifier(org.jkiss.dbeaver.model.data.DBDRowIdentifier)

Example 4 with DBSEntityAttribute

use of org.jkiss.dbeaver.model.struct.DBSEntityAttribute in project dbeaver by dbeaver.

the class SQLForeignKeyManager method getNestedDeclaration.

@Override
protected StringBuilder getNestedDeclaration(TABLE_TYPE owner, DBECommandAbstract<OBJECT_TYPE> command, Map<String, Object> options) {
    OBJECT_TYPE foreignKey = command.getObject();
    boolean legacySyntax = isLegacyForeignKeySyntax(owner);
    // Create column
    String constraintName = DBUtils.getQuotedIdentifier(foreignKey.getDataSource(), foreignKey.getName());
    StringBuilder decl = new StringBuilder(40);
    if (!legacySyntax || !foreignKey.isPersisted()) {
        decl.append("CONSTRAINT ");
    }
    if (!legacySyntax) {
        // $NON-NLS-1$
        decl.append(constraintName).append(" ");
    }
    // $NON-NLS-1$
    decl.append(foreignKey.getConstraintType().getName().toUpperCase(Locale.ENGLISH)).append(// $NON-NLS-1$
    " (");
    try {
        // Get columns using void monitor
        final Collection<? extends DBSEntityAttributeRef> columns = command.getObject().getAttributeReferences(new VoidProgressMonitor());
        boolean firstColumn = true;
        for (DBSEntityAttributeRef constraintColumn : CommonUtils.safeCollection(columns)) {
            final DBSEntityAttribute attribute = constraintColumn.getAttribute();
            // $NON-NLS-1$
            if (!firstColumn)
                decl.append(",");
            firstColumn = false;
            if (attribute != null) {
                decl.append(DBUtils.getQuotedIdentifier(attribute));
            }
        }
    } catch (DBException e) {
        log.error("Can't obtain reference attributes", e);
    }
    final DBSEntityConstraint refConstraint = foreignKey.getReferencedConstraint();
    final String refTableName = refConstraint == null ? "<?>" : (CommonUtils.getOption(options, DBPScriptObject.OPTION_FULLY_QUALIFIED_NAMES, true) ? DBUtils.getObjectFullName(refConstraint.getParentObject(), DBPEvaluationContext.DDL) : DBUtils.getQuotedIdentifier(refConstraint.getParentObject()));
    // $NON-NLS-1$ //$NON-NLS-2$
    decl.append(") REFERENCES ").append(refTableName).append("(");
    if (refConstraint instanceof DBSEntityReferrer) {
        try {
            boolean firstColumn = true;
            List<? extends DBSEntityAttributeRef> columns = ((DBSEntityReferrer) refConstraint).getAttributeReferences(new VoidProgressMonitor());
            for (DBSEntityAttributeRef constraintColumn : CommonUtils.safeCollection(columns)) {
                // $NON-NLS-1$
                if (!firstColumn)
                    decl.append(",");
                firstColumn = false;
                final DBSEntityAttribute attribute = constraintColumn.getAttribute();
                if (attribute != null) {
                    decl.append(DBUtils.getQuotedIdentifier(attribute));
                }
            }
        } catch (DBException e) {
            log.error("Can't obtain ref constraint reference attributes", e);
        }
    }
    // $NON-NLS-1$
    decl.append(")");
    if (foreignKey.getDeleteRule() != null && !CommonUtils.isEmpty(foreignKey.getDeleteRule().getClause())) {
        // $NON-NLS-1$
        decl.append(" ON DELETE ").append(foreignKey.getDeleteRule().getClause());
    }
    if (foreignKey.getUpdateRule() != null && !CommonUtils.isEmpty(foreignKey.getUpdateRule().getClause())) {
        // $NON-NLS-1$
        decl.append(" ON UPDATE ").append(foreignKey.getUpdateRule().getClause());
    }
    if (legacySyntax) {
        // $NON-NLS-1$
        decl.append(" CONSTRAINT ").append(constraintName);
    }
    return decl;
}
Also used : DBSEntityAttributeRef(org.jkiss.dbeaver.model.struct.DBSEntityAttributeRef) DBException(org.jkiss.dbeaver.DBException) DBSEntityReferrer(org.jkiss.dbeaver.model.struct.DBSEntityReferrer) DBSEntityConstraint(org.jkiss.dbeaver.model.struct.DBSEntityConstraint) DBSEntityAttribute(org.jkiss.dbeaver.model.struct.DBSEntityAttribute) VoidProgressMonitor(org.jkiss.dbeaver.model.runtime.VoidProgressMonitor)

Example 5 with DBSEntityAttribute

use of org.jkiss.dbeaver.model.struct.DBSEntityAttribute in project dbeaver by serge-rider.

the class SQLConstraintManager method appendConstraintDefinition.

protected void appendConstraintDefinition(StringBuilder decl, DBECommandAbstract<OBJECT_TYPE> command) {
    // $NON-NLS-1$
    decl.append(" (");
    // Get columns using void monitor
    try {
        List<? extends DBSEntityAttributeRef> attrs = command.getObject().getAttributeReferences(new VoidProgressMonitor());
        if (attrs != null) {
            boolean firstColumn = true;
            for (DBSEntityAttributeRef constraintColumn : attrs) {
                final DBSEntityAttribute attribute = constraintColumn.getAttribute();
                if (attribute == null) {
                    continue;
                }
                // $NON-NLS-1$
                if (!firstColumn)
                    decl.append(",");
                firstColumn = false;
                decl.append(DBUtils.getQuotedIdentifier(attribute));
            }
        }
    } catch (DBException e) {
        log.warn("Can't obtain attribute references", e);
    }
    // $NON-NLS-1$
    decl.append(")");
}
Also used : DBSEntityAttributeRef(org.jkiss.dbeaver.model.struct.DBSEntityAttributeRef) DBException(org.jkiss.dbeaver.DBException) DBSEntityAttribute(org.jkiss.dbeaver.model.struct.DBSEntityAttribute) VoidProgressMonitor(org.jkiss.dbeaver.model.runtime.VoidProgressMonitor)

Aggregations

DBSEntityAttribute (org.jkiss.dbeaver.model.struct.DBSEntityAttribute)77 DBException (org.jkiss.dbeaver.DBException)25 DBSEntity (org.jkiss.dbeaver.model.struct.DBSEntity)16 VoidProgressMonitor (org.jkiss.dbeaver.model.runtime.VoidProgressMonitor)14 ArrayList (java.util.ArrayList)11 DBDAttributeBinding (org.jkiss.dbeaver.model.data.DBDAttributeBinding)10 DBSAttributeBase (org.jkiss.dbeaver.model.struct.DBSAttributeBase)10 EditIndexPage (org.jkiss.dbeaver.ui.editors.object.struct.EditIndexPage)10 DBSEntityAttributeRef (org.jkiss.dbeaver.model.struct.DBSEntityAttributeRef)9 MySQLTableColumn (org.jkiss.dbeaver.ext.mysql.model.MySQLTableColumn)6 DBDRowIdentifier (org.jkiss.dbeaver.model.data.DBDRowIdentifier)6 DBRProgressMonitor (org.jkiss.dbeaver.model.runtime.DBRProgressMonitor)6 DBSDataType (org.jkiss.dbeaver.model.struct.DBSDataType)6 EditConstraintPage (org.jkiss.dbeaver.ui.editors.object.struct.EditConstraintPage)6 TableItem (org.eclipse.swt.widgets.TableItem)5 BigDecimal (java.math.BigDecimal)4 SQLServerTableColumn (org.jkiss.dbeaver.ext.mssql.model.SQLServerTableColumn)4 KeyAdapter (org.eclipse.swt.events.KeyAdapter)3 KeyEvent (org.eclipse.swt.events.KeyEvent)3 GridData (org.eclipse.swt.layout.GridData)3