Search in sources :

Example 1 with SelectSource

use of com.robotoworks.mechanoid.db.sqliteModel.SelectSource in project mechanoid by robotoworks.

the class XSqliteModelScopeProvider method scope_ColumnSourceRef_column.

public IScope scope_ColumnSourceRef_column(final ColumnSourceRef context, final EReference reference) {
    SelectSource _source = context.getSource();
    boolean _equals = Objects.equal(_source, null);
    if (_equals) {
        IScope scope = this.buildScopeForColumnSourceRef_column(context, context);
        return scope;
    } else {
        SelectSource _source_1 = context.getSource();
        if ((_source_1 instanceof SingleSourceTable)) {
            SelectSource _source_2 = context.getSource();
            SingleSourceTable tableSource = ((SingleSourceTable) _source_2);
            DDLStatement _ancestorOfType = ModelUtil.<DDLStatement>getAncestorOfType(tableSource, DDLStatement.class);
            TableDefinition _tableReference = tableSource.getTableReference();
            ArrayList<EObject> _findColumnDefs = ModelUtil.findColumnDefs(_ancestorOfType, _tableReference);
            return Scopes.scopeFor(_findColumnDefs);
        } else {
            SelectSource _source_3 = context.getSource();
            if ((_source_3 instanceof SingleSourceSelectStatement)) {
                SelectSource _source_4 = context.getSource();
                SingleSourceSelectStatement selectStmtSource = ((SingleSourceSelectStatement) _source_4);
                SelectStatement _selectStatement = selectStmtSource.getSelectStatement();
                SelectCoreExpression _core = _selectStatement.getCore();
                ArrayList<EObject> _allReferenceableColumns = ModelUtil.getAllReferenceableColumns(_core);
                return Scopes.scopeFor(_allReferenceableColumns);
            }
        }
    }
    return IScope.NULLSCOPE;
}
Also used : SelectStatement(com.robotoworks.mechanoid.db.sqliteModel.SelectStatement) SingleSourceSelectStatement(com.robotoworks.mechanoid.db.sqliteModel.SingleSourceSelectStatement) DDLStatement(com.robotoworks.mechanoid.db.sqliteModel.DDLStatement) SingleSourceSelectStatement(com.robotoworks.mechanoid.db.sqliteModel.SingleSourceSelectStatement) SelectCoreExpression(com.robotoworks.mechanoid.db.sqliteModel.SelectCoreExpression) EObject(org.eclipse.emf.ecore.EObject) IScope(org.eclipse.xtext.scoping.IScope) SingleSourceTable(com.robotoworks.mechanoid.db.sqliteModel.SingleSourceTable) TableDefinition(com.robotoworks.mechanoid.db.sqliteModel.TableDefinition) SelectSource(com.robotoworks.mechanoid.db.sqliteModel.SelectSource)

Example 2 with SelectSource

use of com.robotoworks.mechanoid.db.sqliteModel.SelectSource in project mechanoid by robotoworks.

the class ColumnSourceRefImpl method setSource.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setSource(SelectSource newSource) {
    SelectSource oldSource = source;
    source = newSource;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, SqliteModelPackage.COLUMN_SOURCE_REF__SOURCE, oldSource, source));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) SelectSource(com.robotoworks.mechanoid.db.sqliteModel.SelectSource)

Aggregations

SelectSource (com.robotoworks.mechanoid.db.sqliteModel.SelectSource)2 DDLStatement (com.robotoworks.mechanoid.db.sqliteModel.DDLStatement)1 SelectCoreExpression (com.robotoworks.mechanoid.db.sqliteModel.SelectCoreExpression)1 SelectStatement (com.robotoworks.mechanoid.db.sqliteModel.SelectStatement)1 SingleSourceSelectStatement (com.robotoworks.mechanoid.db.sqliteModel.SingleSourceSelectStatement)1 SingleSourceTable (com.robotoworks.mechanoid.db.sqliteModel.SingleSourceTable)1 TableDefinition (com.robotoworks.mechanoid.db.sqliteModel.TableDefinition)1 EObject (org.eclipse.emf.ecore.EObject)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1 IScope (org.eclipse.xtext.scoping.IScope)1