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