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


Java SugarRecord.findById方法代碼示例

本文整理匯總了Java中com.orm.SugarRecord.findById方法的典型用法代碼示例。如果您正苦於以下問題:Java SugarRecord.findById方法的具體用法?Java SugarRecord.findById怎麽用?Java SugarRecord.findById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.orm.SugarRecord的用法示例。


在下文中一共展示了SugarRecord.findById方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: objectLongAnnotatedTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void objectLongAnnotatedTest() {
    Long objectLong = new Long(25L);
    save(new LongFieldAnnotatedModel(objectLong));
    LongFieldAnnotatedModel model = SugarRecord.findById(LongFieldAnnotatedModel.class, 1);
    assertEquals(objectLong, model.getLong());
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:8,代碼來源:LongFieldTests.java

示例2: objectShortExtendedTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void objectShortExtendedTest() {
    Short objectShort = new Short((short) 25);
    save(new ShortFieldExtendedModel(objectShort));
    ShortFieldExtendedModel model = SugarRecord.findById(ShortFieldExtendedModel.class, 1);
    assertEquals(objectShort, model.getShort());
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:8,代碼來源:ShortFieldTests.java

示例3: stringAnnotatedTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void stringAnnotatedTest() {
    String string = "Test String";
    save(new StringFieldAnnotatedModel(string));
    StringFieldAnnotatedModel model = SugarRecord.findById(StringFieldAnnotatedModel.class, 1);
    assertEquals(string, model.getString());
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:8,代碼來源:StringFieldTests.java

示例4: findByIdStringsManyTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void findByIdStringsManyTest() throws Exception {
    for (int i = 1; i <= 10; i++) {
        save(new SimpleExtendedModel());
    }
    List<SimpleExtendedModel> models =
            SugarRecord.findById(SimpleExtendedModel.class, new String[]{"1", "3", "6", "10"});
    assertEquals(4, models.size());
    assertEquals(new Long(1L), models.get(0).getId());
    assertEquals(new Long(3L), models.get(1).getId());
    assertEquals(new Long(6L), models.get(2).getId());
    assertEquals(new Long(10L), models.get(3).getId());
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:14,代碼來源:SimpleExtendedModelTests.java

示例5: objectShortAnnotatedTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void objectShortAnnotatedTest() {
    Short objectShort = new Short((short) 25);
    save(new ShortFieldAnnotatedModel(objectShort));
    ShortFieldAnnotatedModel model = SugarRecord.findById(ShortFieldAnnotatedModel.class, 1);
    assertEquals(objectShort, model.getShort());
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:8,代碼來源:ShortFieldTests.java

示例6: objectFloatExtendedTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void objectFloatExtendedTest() {
    Float objectFloat = new Float(25F);
    save(new FloatFieldExtendedModel(objectFloat));
    FloatFieldExtendedModel model = SugarRecord.findById(FloatFieldExtendedModel.class, 1);
    assertEquals(objectFloat, model.getFloat());
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:8,代碼來源:FloatFieldTests.java

示例7: objectDoubleAnnotatedTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void objectDoubleAnnotatedTest() {
    Double objectDouble = new Double(25.0);
    save(new DoubleFieldAnnotatedModel(objectDouble));
    DoubleFieldAnnotatedModel model = SugarRecord.findById(DoubleFieldAnnotatedModel.class, 1);
    assertEquals(objectDouble, model.getDouble());
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:8,代碼來源:DoubleFieldTests.java

示例8: integerExtendedTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void integerExtendedTest() {
    Integer integer = new Integer(25);
    save(new IntegerFieldExtendedModel(integer));
    IntegerFieldExtendedModel model = SugarRecord.findById(IntegerFieldExtendedModel.class, 1);
    assertEquals(integer, model.getInteger());
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:8,代碼來源:IntegerFieldTests.java

示例9: stringExtendedTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void stringExtendedTest() {
    String string = "Test String";
    save(new StringFieldExtendedModel(string));
    StringFieldExtendedModel model = SugarRecord.findById(StringFieldExtendedModel.class, 1);
    assertEquals(string, model.getString());
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:8,代碼來源:StringFieldTests.java

示例10: 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());
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:16,代碼來源:FirstAndLastTests.java

示例11: isInDB

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Override
public boolean isInDB(Todo flight) {
    return SugarRecord.findById(Todo.class, flight.getId()) != null;
}
 
開發者ID:bpatrik,項目名稱:mobsoft-lab,代碼行數:5,代碼來源:SugarOrmRepository.java

示例12: rawBooleanAnnotatedTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void rawBooleanAnnotatedTest() {
    save(new BooleanFieldAnnotatedModel(true));
    BooleanFieldAnnotatedModel model = SugarRecord.findById(BooleanFieldAnnotatedModel.class, 1);
    assertEquals(true, model.getRawBoolean());
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:7,代碼來源:BooleanFieldTests.java

示例13: nullLongAnnotatedTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void nullLongAnnotatedTest() {
    save(new LongFieldAnnotatedModel());
    LongFieldAnnotatedModel model = SugarRecord.findById(LongFieldAnnotatedModel.class, 1);
    assertNull(model.getLong());
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:7,代碼來源:LongFieldTests.java

示例14: rawFloatExtendedTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void rawFloatExtendedTest() {
    save(new FloatFieldExtendedModel(25F));
    FloatFieldExtendedModel model = SugarRecord.findById(FloatFieldExtendedModel.class, 1);
    assertEquals(25F, model.getRawFloat(), 0.0000000001F);
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:7,代碼來源:FloatFieldTests.java

示例15: rawBooleanExtendedTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void rawBooleanExtendedTest() {
    save(new BooleanFieldExtendedModel(true));
    BooleanFieldExtendedModel model = SugarRecord.findById(BooleanFieldExtendedModel.class, 1);
    assertEquals(true, model.getRawBoolean());
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:7,代碼來源:BooleanFieldTests.java


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