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


Java Migrator.addField方法代码示例

本文整理汇总了Java中com.orm.androrm.migration.Migrator.addField方法的典型用法代码示例。如果您正苦于以下问题:Java Migrator.addField方法的具体用法?Java Migrator.addField怎么用?Java Migrator.addField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.orm.androrm.migration.Migrator的用法示例。


在下文中一共展示了Migrator.addField方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: migrate

import com.orm.androrm.migration.Migrator; //导入方法依赖的package包/类
@Override
protected void migrate(Context context) {
    Migrator<GameSession> migrator = new Migrator<GameSession>(GameSession.class);

    // Add level field
    migrator.addField("current_level", new IntegerField());

    // Add points field
    migrator.addField("points", new IntegerField());
    migrator.addField("account_balance", new IntegerField());
    migrator.addField("gross_income", new IntegerField());
    migrator.addField("person_name", new CharField());

    // Add state fields
    migrator.addField("is_active", new BooleanField());
    migrator.addField("pref_music", new BooleanField());

    // roll out all migrations
    migrator.migrate(context);
    return;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:22,代码来源:GameSession.java

示例2: migrate

import com.orm.androrm.migration.Migrator; //导入方法依赖的package包/类
@Override
protected void migrate(Context context) {
    Migrator<LetterTile> migrator = new Migrator<LetterTile>(LetterTile.class);

    migrator.addField("builder", new ForeignKeyField<LetterBuilder>(LetterBuilder.class));

    // roll out all migrations
    migrator.migrate(context);
    return;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:11,代码来源:LetterTile.java

示例3: migrate

import com.orm.androrm.migration.Migrator; //导入方法依赖的package包/类
@Override
protected void migrate(Context context) {
    Migrator<WordTile> migrator = new Migrator<WordTile>(WordTile.class);

    migrator.addField("stock", new IntegerField());

    // roll out all migrations
    migrator.migrate(context);
    return;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:11,代码来源:WordTile.java

示例4: migrate

import com.orm.androrm.migration.Migrator; //导入方法依赖的package包/类
@Override
protected void migrate(Context context) {
    Migrator<RequestItem> migrator = new Migrator<RequestItem>(RequestItem.class);

    // Add history field
    migrator.addField("history", new IntegerField());

    // roll out all migrations
    migrator.migrate(context);
    return;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:12,代码来源:RequestItem.java

示例5: migrate

import com.orm.androrm.migration.Migrator; //导入方法依赖的package包/类
@Override
protected void migrate(Context context) {
    Migrator<InventoryItem> migrator = new Migrator<InventoryItem>(InventoryItem.class);

    // Add history field
    migrator.addField("history", new IntegerField());

    // roll out all migrations
    migrator.migrate(context);
    return;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:12,代码来源:InventoryItem.java

示例6: migrate

import com.orm.androrm.migration.Migrator; //导入方法依赖的package包/类
@Override
protected void migrate(Context context) {
    Migrator<MarketRequest> migrator = new Migrator<MarketRequest>(MarketRequest.class);

    migrator.addField("coins", new IntegerField());
    migrator.addField("points", new IntegerField());

    // roll out all migrations
    migrator.migrate(context);
    return;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:12,代码来源:MarketRequest.java

示例7: migrate

import com.orm.androrm.migration.Migrator; //导入方法依赖的package包/类
@Override
protected void migrate(Context context) {
    Migrator<GameTile> migrator = new Migrator<GameTile>(GameTile.class);

    migrator.addField("timer", new ForeignKeyField<GameTileTimer>(GameTileTimer.class));
    // roll out all migrations
    migrator.migrate(context);
    return;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:10,代码来源:GameTile.java

示例8: testForeignKeyAdd

import com.orm.androrm.migration.Migrator; //导入方法依赖的package包/类
public void testForeignKeyAdd() {
	assertFalse(mHelper.hasField(EmptyModel.class, "mProduct"));
	
	Migrator<EmptyModel> migrator = new Migrator<EmptyModel>(EmptyModel.class);
	migrator.addField("mProduct", new ForeignKeyField<Product>(Product.class));
	migrator.migrate(getContext());
	
	assertTrue(mHelper.hasField(EmptyModel.class, "mProduct"));
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:10,代码来源:ForeignKeyMigrationTest.java

示例9: migrate

import com.orm.androrm.migration.Migrator; //导入方法依赖的package包/类
@Override
protected void migrate(Context context) {
    Migrator<Scripture> migrator =
            new Migrator<Scripture>(Scripture.class);
    migrator.addField("context", new CharField());
    migrator.addField("application", new CharField());
    migrator.addField("doctrine", new CharField());
    migrator.addField("position", new IntegerField());
    migrator.addField("startRatio", new DoubleField());
    migrator.migrate(context);
}
 
开发者ID:tooke7,项目名称:sm-helper,代码行数:12,代码来源:Scripture.java

示例10: migrate

import com.orm.androrm.migration.Migrator; //导入方法依赖的package包/类
@Override
protected void migrate(Context context) {
	Migrator<ModelWithMigration> migrator = new Migrator<ModelWithMigration>(ModelWithMigration.class);
	migrator.addField("mTestField", new CharField());
	migrator.migrate(context);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:7,代码来源:ModelWithMigration.java

示例11: migrate

import com.orm.androrm.migration.Migrator; //导入方法依赖的package包/类
@Override
protected void migrate(Context context) {
    Migrator<Book> migrator = new Migrator<Book>(Book.class);
    migrator.addField("position", new IntegerField());
    migrator.migrate(context);
}
 
开发者ID:tooke7,项目名称:sm-helper,代码行数:7,代码来源:Book.java

示例12: testLocationFieldAdd

import com.orm.androrm.migration.Migrator; //导入方法依赖的package包/类
public void testLocationFieldAdd() {
	Migrator<EmptyModel> migrator = new Migrator<EmptyModel>(EmptyModel.class);
	
	assertFalse(mHelper.hasField(EmptyModel.class, "mLocationLat"));
	assertFalse(mHelper.hasField(EmptyModel.class, "mLocationLng"));
	
	migrator.addField("mLocation", new LocationField());
	migrator.migrate(getContext());
	
	assertTrue(mHelper.hasField(EmptyModel.class, "mLocationLat"));
	assertTrue(mHelper.hasField(EmptyModel.class, "mLocationLng"));
	
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:14,代码来源:DataFieldMigrationTest.java

示例13: fieldAdd

import com.orm.androrm.migration.Migrator; //导入方法依赖的package包/类
private void fieldAdd(String name, DataField<?> field) {
	Migrator<EmptyModel> migrator = new Migrator<EmptyModel>(EmptyModel.class);
	
	assertFalse(mHelper.hasField(EmptyModel.class, name));
	
	migrator.addField(name, field);
	migrator.migrate(getContext());
	
	assertTrue(mHelper.hasField(EmptyModel.class, name));
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:11,代码来源:DataFieldMigrationTest.java


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