當前位置: 首頁>>代碼示例>>Java>>正文


Java Migrator類代碼示例

本文整理匯總了Java中com.orm.androrm.migration.Migrator的典型用法代碼示例。如果您正苦於以下問題:Java Migrator類的具體用法?Java Migrator怎麽用?Java Migrator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Migrator類屬於com.orm.androrm.migration包,在下文中一共展示了Migrator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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<Gift> migrator = new Migrator<Gift>(Gift.class);

    // roll out all migrations
    migrator.migrate(context);
    return;
}
 
開發者ID:Linguaculturalists,項目名稱:Phoenicia,代碼行數:9,代碼來源:Gift.java

示例6: migrate

import com.orm.androrm.migration.Migrator; //導入依賴的package包/類
@Override
protected void migrate(Context context) {
    Migrator<DecorationTile> migrator = new Migrator<DecorationTile>(DecorationTile.class);

    // roll out all migrations
    migrator.migrate(context);
    return;
}
 
開發者ID:Linguaculturalists,項目名稱:Phoenicia,代碼行數:9,代碼來源:DecorationTile.java

示例7: migrate

import com.orm.androrm.migration.Migrator; //導入依賴的package包/類
@Override
protected void migrate(Context context) {
    Migrator<DefaultTile> migrator = new Migrator<DefaultTile>(DefaultTile.class);

    // roll out all migrations
    migrator.migrate(context);
    return;
}
 
開發者ID:Linguaculturalists,項目名稱:Phoenicia,代碼行數:9,代碼來源:DefaultTile.java

示例8: 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

示例9: 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

示例10: 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

示例11: migrate

import com.orm.androrm.migration.Migrator; //導入依賴的package包/類
@Override
protected void migrate(Context context) {
    Migrator<GiftRequest> migrator = new Migrator<GiftRequest>(GiftRequest.class);

    // roll out all migrations
    migrator.migrate(context);
    return;
}
 
開發者ID:Linguaculturalists,項目名稱:Phoenicia,代碼行數:9,代碼來源:GiftRequest.java

示例12: testRenameRelation

import com.orm.androrm.migration.Migrator; //導入依賴的package包/類
public void testRenameRelation() {
	Migrator<NewModelWithRelation> migrator = new Migrator<NewModelWithRelation>(NewModelWithRelation.class);
	
	assertTrue(mHelper.hasRelationTable(ModelWithRelation.class));
	assertTrue(mHelper.tableExists("emptymodel_modelwithrelation"));
	
	ModelWithRelation model1 = new ModelWithRelation();
	model1.save(getContext());

	EmptyModel empty = new EmptyModel();
	empty.save(getContext());
	
	model1.addRelation(empty);
	model1.save(getContext());
	
	assertEquals(1, model1.getRelations(getContext()).count());
	assertEquals(0, NewModelWithRelation.objects(getContext()).count());
	
	migrator.renameModel("ModelWithRelation", NewModelWithRelation.class);
	migrator.migrate(getContext());
	
	NewModelWithRelation one = NewModelWithRelation.objects(getContext()).get(1);
	assertEquals(1, one.getRelations(getContext()).count());
	
	assertTrue(mHelper.hasRelationTable(NewModelWithRelation.class));
	assertFalse(mHelper.hasRelationTable(ModelWithRelation.class));
	assertFalse(mHelper.tableExists("emptymodel_modelwithrelation"));
	
	Filter filter = new Filter();
	filter.is("mModel", "newmodelwithrelation")
	      .is("mAction", "rename_relation")
	      .is("mValue", "emptymodel_modelwithrelation");
	
	assertEquals(1, Migration.objects(getContext()).filter(filter).count());
}
 
開發者ID:Linguaculturalists,項目名稱:Phoenicia,代碼行數:36,代碼來源:RenameModelMigrationTest.java

示例13: 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

示例14: 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

示例15: 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


注:本文中的com.orm.androrm.migration.Migrator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。