当前位置: 首页>>代码示例>>Java>>正文


Java DatabaseAdapter.setModels方法代码示例

本文整理汇总了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);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:26,代码来源:GameActivity.java

示例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);

}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:24,代码来源:BankTest.java

示例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);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:24,代码来源:InventoryTest.java

示例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();
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:13,代码来源:MigrationHelperTest.java

示例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);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:10,代码来源:FilterTest.java

示例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();
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:14,代码来源:RenameModelMigrationTest.java

示例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"));
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:10,代码来源:ModelTest.java

示例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();
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:11,代码来源:ForeignKeyMigrationTest.java

示例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);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:9,代码来源:TransactionTest.java

示例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);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:12,代码来源:ForeignKeyFieldTest.java

示例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);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:11,代码来源:OneToManyFieldTest.java

示例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);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:12,代码来源:ManyToManyFieldTest.java

示例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);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:10,代码来源:ModelTest.java

示例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"));
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:12,代码来源:FieldCacheTest.java

示例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"));
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:12,代码来源:FieldCacheTest.java


注:本文中的com.orm.androrm.DatabaseAdapter.setModels方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。