本文整理匯總了Java中com.orm.SugarRecord.first方法的典型用法代碼示例。如果您正苦於以下問題:Java SugarRecord.first方法的具體用法?Java SugarRecord.first怎麽用?Java SugarRecord.first使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.orm.SugarRecord
的用法示例。
在下文中一共展示了SugarRecord.first方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: firstExtendedTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void firstExtendedTest() {
Float firstObjectFloat = new Float(25F);
Float lastObjectFloat = new Float(50F);
save(new FloatFieldExtendedModel(firstObjectFloat));
save(new FloatFieldExtendedModel(lastObjectFloat));
FloatFieldExtendedModel model = SugarRecord.first(FloatFieldExtendedModel.class);
assertEquals(firstObjectFloat, model.getFloat());
}
示例2: firstDeletedRecordExtendedTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void firstDeletedRecordExtendedTest() {
Float firstObjectFloat = new Float(15F);
Float secondObjectFloat = new Float(25F);
Float thirdObjectFloat = new Float(35F);
Float fourthObjectFloat = new Float(45F);
save(new FloatFieldExtendedModel(firstObjectFloat));
save(new FloatFieldExtendedModel(secondObjectFloat));
save(new FloatFieldExtendedModel(thirdObjectFloat));
save(new FloatFieldExtendedModel(fourthObjectFloat));
FloatFieldExtendedModel firstRecord = SugarRecord.findById(FloatFieldExtendedModel.class, 1);
firstRecord.delete();
FloatFieldExtendedModel model = SugarRecord.first(FloatFieldExtendedModel.class);
assertEquals(secondObjectFloat, model.getFloat());
}
示例3: oneItemExtendedTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void oneItemExtendedTest() {
save(new FloatFieldExtendedModel(new Float(25F)));
FloatFieldExtendedModel firstModel = SugarRecord.first(FloatFieldExtendedModel.class);
FloatFieldExtendedModel lastModel = SugarRecord.last(FloatFieldExtendedModel.class);
assertEquals(firstModel.getFloat(), lastModel.getFloat());
}
示例4: firstAnnotatedTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void firstAnnotatedTest() {
Float firstObjectFloat = new Float(25F);
Float lastObjectFloat = new Float(50F);
save(new FloatFieldAnnotatedModel(firstObjectFloat));
save(new FloatFieldAnnotatedModel(lastObjectFloat));
FloatFieldAnnotatedModel model = SugarRecord.first(FloatFieldAnnotatedModel.class);
assertEquals(firstObjectFloat, model.getFloat());
}
示例5: firstDeletedRecordAnnotatedTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void firstDeletedRecordAnnotatedTest() {
Float firstObjectFloat = new Float(15F);
Float secondObjectFloat = new Float(25F);
Float thirdObjectFloat = new Float(35F);
Float fourthObjectFloat = new Float(45F);
save(new FloatFieldAnnotatedModel(firstObjectFloat));
save(new FloatFieldAnnotatedModel(secondObjectFloat));
save(new FloatFieldAnnotatedModel(thirdObjectFloat));
save(new FloatFieldAnnotatedModel(fourthObjectFloat));
FloatFieldAnnotatedModel firstRecord = SugarRecord.findById(FloatFieldAnnotatedModel.class, 1);
SugarRecord.delete(firstRecord);
FloatFieldAnnotatedModel model = SugarRecord.first(FloatFieldAnnotatedModel.class);
assertEquals(secondObjectFloat, model.getFloat());
}
示例6: oneItemAnnotatedTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void oneItemAnnotatedTest() {
save(new FloatFieldAnnotatedModel(new Float(25F)));
FloatFieldAnnotatedModel firstModel = SugarRecord.first(FloatFieldAnnotatedModel.class);
FloatFieldAnnotatedModel lastModel = SugarRecord.last(FloatFieldAnnotatedModel.class);
assertEquals(firstModel.getFloat(), lastModel.getFloat());
}