Search in sources :

Example 1 with CreateTriggerStatement

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

the class StatementSequenceValidator method _sequence.

protected void _sequence(final DropTriggerStatement stmt) {
    CreateTriggerStatement _trigger = stmt.getTrigger();
    String _name = _trigger.getName();
    this.triggers.remove(_name);
}
Also used : CreateTriggerStatement(com.robotoworks.mechanoid.db.sqliteModel.CreateTriggerStatement)

Example 2 with CreateTriggerStatement

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

the class XSqliteModelScopeProvider method scope_OldColumn_column.

public IScope scope_OldColumn_column(final OldColumn context, final EReference reference) {
    CreateTriggerStatement trigger = ModelUtil.<CreateTriggerStatement>getAncestorOfType(context, CreateTriggerStatement.class);
    boolean _notEquals = (!Objects.equal(trigger, null));
    if (_notEquals) {
        TableDefinition _table = trigger.getTable();
        ArrayList<EObject> _findColumnDefs = ModelUtil.findColumnDefs(trigger, _table);
        return Scopes.scopeFor(_findColumnDefs);
    }
    return IScope.NULLSCOPE;
}
Also used : CreateTriggerStatement(com.robotoworks.mechanoid.db.sqliteModel.CreateTriggerStatement) EObject(org.eclipse.emf.ecore.EObject) TableDefinition(com.robotoworks.mechanoid.db.sqliteModel.TableDefinition)

Example 3 with CreateTriggerStatement

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

the class StatementSequenceValidator method _validateStatement.

protected void _validateStatement(final StatementSequenceValidatorResult result, final DropTriggerStatement stmt) {
    CreateTriggerStatement _trigger = stmt.getTrigger();
    String _name = _trigger.getName();
    boolean _contains = this.triggers.contains(_name);
    boolean _not = (!_contains);
    if (_not) {
        result.valid = false;
        result.message = "No such trigger";
        result.feature = SqliteModelPackage.Literals.DROP_TRIGGER_STATEMENT__TRIGGER;
    }
}
Also used : CreateTriggerStatement(com.robotoworks.mechanoid.db.sqliteModel.CreateTriggerStatement)

Example 4 with CreateTriggerStatement

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

the class XSqliteModelScopeProvider method scope_NewColumn_column.

public IScope scope_NewColumn_column(final NewColumn context, final EReference reference) {
    CreateTriggerStatement trigger = ModelUtil.<CreateTriggerStatement>getAncestorOfType(context, CreateTriggerStatement.class);
    boolean _notEquals = (!Objects.equal(trigger, null));
    if (_notEquals) {
        TableDefinition _table = trigger.getTable();
        ArrayList<EObject> _findColumnDefs = ModelUtil.findColumnDefs(trigger, _table);
        return Scopes.scopeFor(_findColumnDefs);
    }
    return IScope.NULLSCOPE;
}
Also used : CreateTriggerStatement(com.robotoworks.mechanoid.db.sqliteModel.CreateTriggerStatement) EObject(org.eclipse.emf.ecore.EObject) TableDefinition(com.robotoworks.mechanoid.db.sqliteModel.TableDefinition)

Example 5 with CreateTriggerStatement

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

the class DropTriggerStatementImpl method setTrigger.

/**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
public void setTrigger(CreateTriggerStatement newTrigger) {
    CreateTriggerStatement oldTrigger = trigger;
    trigger = newTrigger;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, SqliteModelPackage.DROP_TRIGGER_STATEMENT__TRIGGER, oldTrigger, trigger));
}
Also used : CreateTriggerStatement(com.robotoworks.mechanoid.db.sqliteModel.CreateTriggerStatement) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Aggregations

CreateTriggerStatement (com.robotoworks.mechanoid.db.sqliteModel.CreateTriggerStatement)5 TableDefinition (com.robotoworks.mechanoid.db.sqliteModel.TableDefinition)2 EObject (org.eclipse.emf.ecore.EObject)2 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1