Search in sources :

Example 6 with InitBlock

use of com.robotoworks.mechanoid.db.sqliteModel.InitBlock 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

InitBlock (com.robotoworks.mechanoid.db.sqliteModel.InitBlock)6 DDLStatement (com.robotoworks.mechanoid.db.sqliteModel.DDLStatement)4 DatabaseBlock (com.robotoworks.mechanoid.db.sqliteModel.DatabaseBlock)4 MigrationBlock (com.robotoworks.mechanoid.db.sqliteModel.MigrationBlock)3 CreateTableStatement (com.robotoworks.mechanoid.db.sqliteModel.CreateTableStatement)2 CreateViewStatement (com.robotoworks.mechanoid.db.sqliteModel.CreateViewStatement)2 ArrayList (java.util.ArrayList)2 Collection (java.util.Collection)1 EList (org.eclipse.emf.common.util.EList)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)1