@Test public void buildCreateQueries_noFts() { EntityBundle entity1 = new EntityBundle("e1", "sq1", asList(createFieldBundle("foo1"), createFieldBundle("bar")), new PrimaryKeyBundle(false, asList("foo1")), Collections.<IndexBundle>emptyList(), Collections.<ForeignKeyBundle>emptyList()); EntityBundle entity2 = new EntityBundle("e2", "sq2", asList(createFieldBundle("foo2"), createFieldBundle("bar")), new PrimaryKeyBundle(false, asList("foo2")), Collections.<IndexBundle>emptyList(), Collections.<ForeignKeyBundle>emptyList()); DatabaseBundle bundle = new DatabaseBundle(1, "hash", asList(entity1, entity2), Collections.<DatabaseViewBundle>emptyList(), Collections.<String>emptyList()); assertThat(bundle.buildCreateQueries(), is(asList("sq1", "sq2"))); }
public List<String> buildCreateQueries() { List<String> result = new ArrayList<>(); Collections.sort(mEntities, new FtsEntityCreateComparator()); for (EntityBundle entityBundle : mEntities) { result.addAll(entityBundle.buildCreateQueries()); } for (DatabaseViewBundle viewBundle : mViews) { result.add(viewBundle.createView()); } result.addAll(mSetupQueries); return result; }
DatabaseBundle implements SchemaEquality<DatabaseBundle> { public List<String> buildCreateQueries() { List<String> result = new ArrayList<>(); Collections.sort(mEntities, new FtsEntityCreateComparator()); for (EntityBundle entityBundle : mEntities) { result.addAll(entityBundle.buildCreateQueries()); } for (DatabaseViewBundle viewBundle : mViews) { result.add(viewBundle.createView()); } result.addAll(mSetupQueries); return result; } }
DatabaseBundle implements SchemaEquality<DatabaseBundle> { public List<String> buildCreateQueries() { List<String> result = new ArrayList<>(); Collections.sort(mEntities, new FtsEntityCreateComparator()); for (EntityBundle entityBundle : mEntities) { result.addAll(entityBundle.buildCreateQueries()); } for (DatabaseViewBundle viewBundle : mViews) { result.add(viewBundle.createView()); } result.addAll(mSetupQueries); return result; } DatabaseBundle(int version, String identityHash, List<EntityBundle> entities,
            List<DatabaseViewBundle> views, List<String> setupQueries); @SuppressWarnings("unused")  DatabaseBundle(); }
DatabaseBundle implements SchemaEquality<DatabaseBundle> { public List<String> buildCreateQueries() { List<String> result = new ArrayList<>(); Collections.sort(mEntities, new FtsEntityCreateComparator()); for (EntityBundle entityBundle : mEntities) { result.addAll(entityBundle.buildCreateQueries()); } for (DatabaseViewBundle viewBundle : mViews) { result.add(viewBundle.createView()); } result.addAll(mSetupQueries); return result; } DatabaseBundle(int version, String identityHash, List<EntityBundle> entities,
            List<DatabaseViewBundle> views, List<String> setupQueries); @SuppressWarnings("unused")  DatabaseBundle(); String getIdentityHash(); int getVersion(); List<EntityBundle> getEntities(); @SuppressWarnings("unused") Map<String, EntityBundle> getEntitiesByTableName(); List<DatabaseViewBundle> getViews(); List<String> buildCreateQueries(); @Override boolean isSchemaEqual(DatabaseBundle other); }
DatabaseBundle implements SchemaEquality<DatabaseBundle> { public List<String> buildCreateQueries() { List<String> result = new ArrayList<>(); Collections.sort(mEntities, new FtsEntityCreateComparator()); for (EntityBundle entityBundle : mEntities) { result.addAll(entityBundle.buildCreateQueries()); } for (DatabaseViewBundle viewBundle : mViews) { result.add(viewBundle.createView()); } result.addAll(mSetupQueries); return result; } DatabaseBundle(int version, String identityHash, List<EntityBundle> entities,
            List<DatabaseViewBundle> views, List<String> setupQueries); @SuppressWarnings("unused")  DatabaseBundle(); String getIdentityHash(); int getVersion(); List<EntityBundle> getEntities(); @SuppressWarnings("unused") Map<String, EntityBundle> getEntitiesByTableName(); List<DatabaseViewBundle> getViews(); List<String> buildCreateQueries(); @Override boolean isSchemaEqual(DatabaseBundle other);  }