Search in sources :

Example 1 with DBDAttributeBindingCustom

use of org.jkiss.dbeaver.model.data.DBDAttributeBindingCustom in project dbeaver by serge-rider.

the class VirtualAttributeEditAction method run.

@Override
public void run() {
    if (attr == null) {
        return;
    }
    DBVEntityAttribute vAttr = ((DBDAttributeBindingCustom) attr).getEntityAttribute();
    DBVEntity vEntity = resultSetViewer.getModel().getVirtualEntity(false);
    if (new EditVirtualAttributePage(resultSetViewer, vAttr).edit(resultSetViewer.getControl().getShell())) {
        vEntity.persistConfiguration();
        resultSetViewer.refreshMetaData();
    }
}
Also used : DBVEntityAttribute(org.jkiss.dbeaver.model.virtual.DBVEntityAttribute) DBDAttributeBindingCustom(org.jkiss.dbeaver.model.data.DBDAttributeBindingCustom) DBVEntity(org.jkiss.dbeaver.model.virtual.DBVEntity)

Example 2 with DBDAttributeBindingCustom

use of org.jkiss.dbeaver.model.data.DBDAttributeBindingCustom in project dbeaver by serge-rider.

the class VirtualAttributeDeleteAction method run.

@Override
public void run() {
    if (!(attr instanceof DBDAttributeBindingCustom)) {
        return;
    }
    DBVEntityAttribute vAttr = ((DBDAttributeBindingCustom) attr).getEntityAttribute();
    if (!UIUtils.confirmAction(resultSetViewer.getControl().getShell(), "Delete column '" + vAttr.getName() + "'", "Are you sure you want to delete virtual column '" + vAttr.getName() + "'?")) {
        return;
    }
    DBVEntity vEntity = resultSetViewer.getModel().getVirtualEntity(false);
    vEntity.removeVirtualAttribute(vAttr);
    vEntity.persistConfiguration();
    resultSetViewer.refreshMetaData();
}
Also used : DBVEntityAttribute(org.jkiss.dbeaver.model.virtual.DBVEntityAttribute) DBDAttributeBindingCustom(org.jkiss.dbeaver.model.data.DBDAttributeBindingCustom) DBVEntity(org.jkiss.dbeaver.model.virtual.DBVEntity)

Aggregations

DBDAttributeBindingCustom (org.jkiss.dbeaver.model.data.DBDAttributeBindingCustom)2 DBVEntity (org.jkiss.dbeaver.model.virtual.DBVEntity)2 DBVEntityAttribute (org.jkiss.dbeaver.model.virtual.DBVEntityAttribute)2