Search in sources :

Example 16 with DDLStatement

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

the class ModelUtil method getConfigInitViews.

public static Collection<CreateViewStatement> getConfigInitViews(final Model model) {
    final ArrayList<CreateViewStatement> items = Lists.<CreateViewStatement>newArrayList();
    DatabaseBlock _database = model.getDatabase();
    InitBlock _init = _database.getInit();
    boolean _notEquals = (!Objects.equal(_init, null));
    if (_notEquals) {
        DatabaseBlock _database_1 = model.getDatabase();
        InitBlock _init_1 = _database_1.getInit();
        EList<DDLStatement> _statements = _init_1.getStatements();
        Iterable<CreateViewStatement> _filter = Iterables.<CreateViewStatement>filter(_statements, CreateViewStatement.class);
        Iterables.<CreateViewStatement>addAll(items, _filter);
    }
    return items;
}
Also used : CreateViewStatement(com.robotoworks.mechanoid.db.sqliteModel.CreateViewStatement) DatabaseBlock(com.robotoworks.mechanoid.db.sqliteModel.DatabaseBlock) DDLStatement(com.robotoworks.mechanoid.db.sqliteModel.DDLStatement) InitBlock(com.robotoworks.mechanoid.db.sqliteModel.InitBlock)

Aggregations

DDLStatement (com.robotoworks.mechanoid.db.sqliteModel.DDLStatement)16 EObject (org.eclipse.emf.ecore.EObject)8 TableDefinition (com.robotoworks.mechanoid.db.sqliteModel.TableDefinition)7 DatabaseBlock (com.robotoworks.mechanoid.db.sqliteModel.DatabaseBlock)6 MigrationBlock (com.robotoworks.mechanoid.db.sqliteModel.MigrationBlock)5 InitBlock (com.robotoworks.mechanoid.db.sqliteModel.InitBlock)4 ArrayList (java.util.ArrayList)3 SingleSourceTable (com.robotoworks.mechanoid.db.sqliteModel.SingleSourceTable)2 EList (org.eclipse.emf.common.util.EList)2 ColumnSource (com.robotoworks.mechanoid.db.sqliteModel.ColumnSource)1 CreateTableStatement (com.robotoworks.mechanoid.db.sqliteModel.CreateTableStatement)1 CreateViewStatement (com.robotoworks.mechanoid.db.sqliteModel.CreateViewStatement)1 SelectCoreExpression (com.robotoworks.mechanoid.db.sqliteModel.SelectCoreExpression)1 SelectList (com.robotoworks.mechanoid.db.sqliteModel.SelectList)1 SelectSource (com.robotoworks.mechanoid.db.sqliteModel.SelectSource)1 SelectStatement (com.robotoworks.mechanoid.db.sqliteModel.SelectStatement)1 SingleSource (com.robotoworks.mechanoid.db.sqliteModel.SingleSource)1 SingleSourceSelectStatement (com.robotoworks.mechanoid.db.sqliteModel.SingleSourceSelectStatement)1 UpdateStatement (com.robotoworks.mechanoid.db.sqliteModel.UpdateStatement)1 StatementSequenceValidatorResult (com.robotoworks.mechanoid.db.validation.StatementSequenceValidatorResult)1