本文整理汇总了Java中com.orm.androrm.DatabaseAdapter.setModels方法的典型用法代码示例。如果您正苦于以下问题:Java DatabaseAdapter.setModels方法的具体用法?Java DatabaseAdapter.setModels怎么用?Java DatabaseAdapter.setModels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.orm.androrm.DatabaseAdapter
的用法示例。
在下文中一共展示了DatabaseAdapter.setModels方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: syncDB
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
/**
* Tell AndOrm about the Models that will be used to read and write to the database.
*/
public void syncDB() {
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(GameSession.class);
models.add(MarketRequest.class);
models.add(RequestItem.class);
models.add(InventoryItem.class);
models.add(DefaultTile.class);
models.add(LetterTile.class);
models.add(WordTile.class);
models.add(LetterBuilder.class);
models.add(WordTileBuilder.class);
models.add(WordBuilder.class);
models.add(WorkshopBuilder.class);
models.add(GameTile.class);
models.add(GameTileBuilder.class);
models.add(GameTileTimer.class);
models.add(DecorationTile.class);
DatabaseAdapter.setDatabaseName("game_db");
DatabaseAdapter adapter = DatabaseAdapter.getInstance(PhoeniciaContext.context);
adapter.setModels(models);
}
示例2: setUp
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
PhoeniciaContext.context = getContext();
assertNotNull("Null context", PhoeniciaContext.context);
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(GameSession.class);
DatabaseAdapter.setDatabaseName("game_db");
DatabaseAdapter adapter = DatabaseAdapter.getInstance(PhoeniciaContext.context);
adapter.setModels(models);
this.session = new GameSession();
session.session_name.set("test session");
session.locale_pack.set("test-locale");
session.current_level.set("test-level");
session.save(PhoeniciaContext.context);
assertNotNull(session.getId());
Bank.init(session);
}
示例3: setUp
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
public void setUp() throws Exception {
super.setUp();
PhoeniciaContext.context = getContext();
assertNotNull("Null context", PhoeniciaContext.context);
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(GameSession.class);
models.add(InventoryItem.class);
DatabaseAdapter.setDatabaseName("game_db");
DatabaseAdapter adapter = DatabaseAdapter.getInstance(PhoeniciaContext.context);
adapter.setModels(models);
GameSession session = new GameSession();
session.session_name.set("test session");
session.locale_pack.set("test-locale");
session.current_level.set("test-level");
session.save(PhoeniciaContext.context);
assertNotNull(session.getId());
Inventory.init(session);
}
示例4: setUp
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
@Override
public void setUp() {
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(EmptyModel.class);
models.add(OneFieldModel.class);
models.add(ModelWithRelation.class);
DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
adapter.setModels(models);
super.setUp();
}
示例5: setUp
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
public void setUp() {
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(Brand.class);
models.add(Person.class);
models.add(Car.class);
DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
adapter.setModels(models);
}
示例6: setUp
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
@Override
public void setUp() {
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(EmptyModel.class);
models.add(ModelWithRelation.class);
models.add(NewEmptyModel.class);
models.add(NewModelWithRelation.class);
DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
adapter.setModels(models);
super.setUp();
}
示例7: testMigrationsRun
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
public void testMigrationsRun() {
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(ModelWithMigration.class);
DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
adapter.setModels(models);
assertTrue(mHelper.hasField(ModelWithMigration.class, "mTestField"));
}
示例8: setUp
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
@Override
public void setUp() {
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(EmptyModel.class);
DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
adapter.setModels(models);
super.setUp();
}
示例9: setUp
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
@Override
public void setUp() {
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(BlankModel.class);
DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
adapter.setModels(models);
}
示例10: setUp
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
@Override
public void setUp() {
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(Product.class);
models.add(Branch.class);
models.add(Brand.class);
models.add(Supplier.class);
DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
adapter.setModels(models);
}
示例11: setUp
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
@Override
public void setUp() {
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(Brand.class);
models.add(Branch.class);
models.add(Product.class);
DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
adapter.setModels(models);
}
示例12: setUp
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
@Override
public void setUp() {
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(Product.class);
models.add(Supplier.class);
models.add(Branch.class);
models.add(Brand.class);
DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
adapter.setModels(models);
}
示例13: setUp
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
@Override
public void setUp() {
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(BlankModel.class);
models.add(BlankModelNoAutoincrement.class);
DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
adapter.setModels(models);
}
示例14: testHasField
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
public void testHasField() {
assertFalse(ModelCache.modelHasField(BlankModel.class, "mName"));
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(BlankModel.class);
DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
adapter.setModels(models);
assertTrue(ModelCache.modelHasField(BlankModel.class, "mName"));
}
示例15: testFieldShortcur
import com.orm.androrm.DatabaseAdapter; //导入方法依赖的package包/类
public void testFieldShortcur() {
assertNull(ModelCache.getField(BlankModelNoAutoincrement.class, "mName"));
List<Class<? extends Model>> models = new ArrayList<Class<? extends Model>>();
models.add(BlankModelNoAutoincrement.class);
DatabaseAdapter adapter = DatabaseAdapter.getInstance(getContext());
adapter.setModels(models);
assertNotNull(ModelCache.getField(BlankModelNoAutoincrement.class, "mName"));
}