use of com.robotoworks.mechanoid.db.sqliteModel.TableDefinition in project mechanoid by robotoworks.
the class AlterTableRenameStatementImpl method setTable.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTable(TableDefinition newTable) {
TableDefinition oldTable = table;
table = newTable;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SqliteModelPackage.ALTER_TABLE_RENAME_STATEMENT__TABLE, oldTable, table));
}
use of com.robotoworks.mechanoid.db.sqliteModel.TableDefinition in project mechanoid by robotoworks.
the class XSqliteModelScopeProvider method scope_UpdateColumnExpression_columnName.
public IScope scope_UpdateColumnExpression_columnName(final UpdateStatement context, final EReference reference) {
DDLStatement containingStmt = ModelUtil.<DDLStatement>getAncestorOfType(context, DDLStatement.class);
TableDefinition _table = context.getTable();
ArrayList<EObject> _findColumnDefs = ModelUtil.findColumnDefs(containingStmt, _table);
return Scopes.scopeFor(_findColumnDefs, IScope.NULLSCOPE);
}
use of com.robotoworks.mechanoid.db.sqliteModel.TableDefinition 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;
}
use of com.robotoworks.mechanoid.db.sqliteModel.TableDefinition in project mechanoid by robotoworks.
the class XSqliteModelScopeProvider method scope_ColumnSourceRef_source.
public IScope scope_ColumnSourceRef_source(final DeleteStatement context, final EReference reference) {
DDLStatement ddl = ModelUtil.<DDLStatement>getAncestorOfType(context, DDLStatement.class);
TableDefinition _table = context.getTable();
ArrayList<EObject> _findColumnDefs = ModelUtil.findColumnDefs(ddl, _table);
return Scopes.scopeFor(_findColumnDefs, IScope.NULLSCOPE);
}
use of com.robotoworks.mechanoid.db.sqliteModel.TableDefinition in project mechanoid by robotoworks.
the class XSqliteModelScopeProvider method scopeForTableDefinitionsBeforeStatement.
public IScope scopeForTableDefinitionsBeforeStatement(final DatabaseBlock db, final DDLStatement stmt, final boolean inclusive) {
ArrayList<TableDefinition> refs = ModelUtil.<TableDefinition>findPreviousStatementsOfType(db, stmt, TableDefinition.class, inclusive);
final HashMap<String, EObject> map = new HashMap<String, EObject>();
List<TableDefinition> _reverse = ListExtensions.<TableDefinition>reverse(refs);
for (final TableDefinition ref : _reverse) {
{
String _name = ref.getName();
boolean _equals = Objects.equal(_name, null);
if (_equals) {
return IScope.NULLSCOPE;
}
String _name_1 = ref.getName();
boolean _containsKey = map.containsKey(_name_1);
boolean _not = (!_containsKey);
if (_not) {
String _name_2 = ref.getName();
map.put(_name_2, ref);
}
}
}
Collection<EObject> _values = map.values();
final Function<EObject, QualifiedName> _function = new Function<EObject, QualifiedName>() {
public QualifiedName apply(final EObject it) {
return NameHelper.getName(((TableDefinition) it));
}
};
return Scopes.<EObject>scopeFor(_values, _function, IScope.NULLSCOPE);
}
Aggregations