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


Java SugarRecord.listAll方法代碼示例

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


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

示例1: listAllSameTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllSameTest() throws Exception {
    SimpleExtendedModel simple = new SimpleExtendedModel();
    save(simple);
    RelationshipMixedBModel nested = new RelationshipMixedBModel(simple);
    save(nested);
    for (int i = 1; i <= 100; i++) {
        save(new NestedMixedABModel(nested));
    }
    List<NestedMixedABModel> models = SugarRecord.listAll(NestedMixedABModel.class);
    assertEquals(100, models.size());
    for (NestedMixedABModel model : models) {
        assertEquals(nested.getId(), model.getNested().getId());
        assertEquals(simple.getId(), model.getNested().getSimple().getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:17,代碼來源:NestedMixedABTests.java

示例2: listAllSameTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllSameTest() throws Exception {
    SimpleExtendedModel simple = new SimpleExtendedModel();
    save(simple);
    RelationshipMixedBModel nested = new RelationshipMixedBModel(simple);
    save(nested);
    for (int i = 1; i <= 100; i++) {
        save(new NestedMixedBBModel(nested));
    }
    List<NestedMixedBBModel> models = SugarRecord.listAll(NestedMixedBBModel.class);
    assertEquals(100, models.size());
    for (NestedMixedBBModel model : models) {
        assertEquals(nested.getId(), model.getNested().getId());
        assertEquals(simple.getId(), model.getNested().getSimple().getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:17,代碼來源:NestedMixedBBTests.java

示例3: listAllDifferentTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllDifferentTest() throws Exception {
    for (int i = 1; i <= 100; i++) {
        SimpleExtendedModel simple = new SimpleExtendedModel();
        save(simple);
        RelationshipMixedBModel nested = new RelationshipMixedBModel(simple);
        save(nested);
        save(new NestedMixedBBModel(nested));
    }
    List<NestedMixedBBModel> models = SugarRecord.listAll(NestedMixedBBModel.class);
    assertEquals(100, models.size());
    for (NestedMixedBBModel model : models) {
        assertEquals(model.getId(), model.getNested().getId());
        assertEquals(model.getId(), model.getNested().getSimple().getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:17,代碼來源:NestedMixedBBTests.java

示例4: listAllSameTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllSameTest() throws Exception {
    SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
    save(simple);
    RelationshipAnnotatedModel nested = new RelationshipAnnotatedModel(simple);
    save(nested);
    for (int i = 1; i <= 100; i++) {
        save(new NestedAnnotatedModel(nested));
    }
    List<NestedAnnotatedModel> models = SugarRecord.listAll(NestedAnnotatedModel.class);
    assertEquals(100, models.size());
    for (NestedAnnotatedModel model : models) {
        assertEquals(nested.getId(), model.getNested().getId());
        assertEquals(simple.getId(), model.getNested().getSimple().getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:17,代碼來源:NestedAnnotatedTests.java

示例5: listAllDifferentTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllDifferentTest() throws Exception {
    for (int i = 1; i <= 100; i++) {
        SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
        save(simple);
        RelationshipAnnotatedModel nested = new RelationshipAnnotatedModel(simple);
        save(nested);
        save(new NestedAnnotatedModel(nested));
    }
    List<NestedAnnotatedModel> models = SugarRecord.listAll(NestedAnnotatedModel.class);
    assertEquals(100, models.size());
    for (NestedAnnotatedModel model : models) {
        assertEquals(model.getId(), model.getNested().getId());
        assertEquals(model.getId(), model.getNested().getSimple().getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:17,代碼來源:NestedAnnotatedTests.java

示例6: listAllDifferentTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllDifferentTest() throws Exception {
    for (int i = 1; i <= 100; i++) {
        SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
        save(simple);
        RelationshipMixedAModel nested = new RelationshipMixedAModel(simple);
        save(nested);
        save(new NestedMixedBAModel(nested));
    }
    List<NestedMixedBAModel> models = SugarRecord.listAll(NestedMixedBAModel.class);
    assertEquals(100, models.size());
    for (NestedMixedBAModel model : models) {
        assertEquals(model.getId(), model.getNested().getId());
        assertEquals(model.getId(), model.getNested().getSimple().getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:17,代碼來源:NestedMixedBATests.java

示例7: listAllSameTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllSameTest() throws Exception {
    SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
    save(simple);
    RelationshipMixedAModel nested = new RelationshipMixedAModel(simple);
    save(nested);
    for (int i = 1; i <= 100; i++) {
        save(new NestedMixedAAModel(nested));
    }
    List<NestedMixedAAModel> models = SugarRecord.listAll(NestedMixedAAModel.class);
    assertEquals(100, models.size());
    for (NestedMixedAAModel model : models) {
        assertEquals(nested.getId(), model.getNested().getId());
        assertEquals(simple.getId(), model.getNested().getSimple().getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:17,代碼來源:NestedMixedAATests.java

示例8: listAllDifferentTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllDifferentTest() throws Exception {
    for (int i = 1; i <= 100; i++) {
        SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
        save(simple);
        RelationshipMixedAModel nested = new RelationshipMixedAModel(simple);
        save(nested);
        save(new NestedMixedAAModel(nested));
    }
    List<NestedMixedAAModel> models = SugarRecord.listAll(NestedMixedAAModel.class);
    assertEquals(100, models.size());
    for (NestedMixedAAModel model : models) {
        assertEquals(model.getId(), model.getNested().getId());
        assertEquals(model.getId(), model.getNested().getSimple().getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:17,代碼來源:NestedMixedAATests.java

示例9: listAllSameTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllSameTest() throws Exception {
    SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
    save(simple);
    RelationshipMixedAModel nested = new RelationshipMixedAModel(simple);
    save(nested);
    for (int i = 1; i <= 100; i++) {
        save(new NestedMixedBAModel(nested));
    }
    List<NestedMixedBAModel> models = SugarRecord.listAll(NestedMixedBAModel.class);
    assertEquals(100, models.size());
    for (NestedMixedBAModel model : models) {
        assertEquals(nested.getId(), model.getNested().getId());
        assertEquals(simple.getId(), model.getNested().getSimple().getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:17,代碼來源:NestedMixedBATests.java

示例10: listAllDifferentTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllDifferentTest() throws Exception {
    for (int i = 1; i <= 100; i++) {
        SimpleExtendedModel simple = new SimpleExtendedModel();
        save(simple);
        RelationshipExtendedModel nested = new RelationshipExtendedModel(simple);
        save(nested);
        save(new NestedExtendedModel(nested));
    }
    List<NestedExtendedModel> models = SugarRecord.listAll(NestedExtendedModel.class);
    assertEquals(100, models.size());
    for (NestedExtendedModel model : models) {
        assertEquals(model.getId(), model.getNested().getId());
        assertEquals(model.getId(), model.getNested().getSimple().getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:17,代碼來源:NestedExtendedTests.java

示例11: initGoogleAccount

import com.orm.SugarRecord; //導入方法依賴的package包/類
private void initGoogleAccount() {
    if (!AccountHolder.isAccountNameSaved(this)) {
        pickAccount();
        return;
    }

    // circles were already loaded
    String ourGoogleId = AccountHolder.getSavedGoogleId(this);
    List<Contact> forAdapter = SugarRecord.listAll(Contact.class);
    if (forAdapter.isEmpty()) { // nothing to load, didn't select account?
        pickAccount();
        return;
    }

    ListIterator<Contact> itr = forAdapter.listIterator();
    while (itr.hasNext()) { // remove us from list, also populate contacts map
        Contact c = itr.next();
        mContacts.put(c.getNativeId(), c);
        if (c.getNativeId().equals(ourGoogleId)) {
            mCurrentPerson = c;
            itr.remove();
        }
    }

    if(mCurrentPerson == null) { // didn't find ourselves, error?
        pickAccount();
        return;
    }

    // successfully loaded cicrles and ourselves from cache
    mPersonList.setAdapter(new AccountsAdapter(this, forAdapter));
    mFloatingMenu.showMenu(true);
    mProgress.animate().alpha(0.0f).setDuration(0).start();
    supportInvalidateOptionsMenu();
}
 
開發者ID:asmolko,項目名稱:MyDebts,代碼行數:36,代碼來源:DebtsListActivity.java

示例12: listAllDifferentTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllDifferentTest() throws Exception {
    for (int i = 1; i <= 100; i++) {
        SimpleExtendedModel simple = new SimpleExtendedModel();
        save(simple);
        save(new RelationshipExtendedModel(simple));
    }
    List<RelationshipExtendedModel> models =
            SugarRecord.listAll(RelationshipExtendedModel.class);
    assertEquals(100, models.size());
    for (RelationshipExtendedModel model : models) {
        assertEquals(model.getId(), model.getSimple().getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:15,代碼來源:RelationshipExtendedTests.java

示例13: listAllSameTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllSameTest() throws Exception {
    SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
    save(simple);
    for (int i = 1; i <= 100; i++) {
        save(new RelationshipAnnotatedModel(simple));
    }
    List<RelationshipAnnotatedModel> models =
            SugarRecord.listAll(RelationshipAnnotatedModel.class);
    assertEquals(100, models.size());
    for (RelationshipAnnotatedModel model : models) {
        assertEquals(simple.getId(), model.getSimple().getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:15,代碼來源:RelationshipAnnotatedTests.java

示例14: listAllDifferentTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllDifferentTest() throws Exception {
    for (int i = 1; i <= 100; i++) {
        SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
        save(simple);
        save(new RelationshipAnnotatedModel(simple));
    }
    List<RelationshipAnnotatedModel> models =
            SugarRecord.listAll(RelationshipAnnotatedModel.class);
    assertEquals(100, models.size());
    for (RelationshipAnnotatedModel model : models) {
        assertEquals(model.getId(), model.getSimple().getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:15,代碼來源:RelationshipAnnotatedTests.java

示例15: listAllTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllTest() throws Exception {
    for (int i = 1; i <= 100; i++) {
        save(new SimpleExtendedModel());
    }
    List<SimpleExtendedModel> models = SugarRecord.listAll(SimpleExtendedModel.class);
    assertEquals(100, models.size());
    for (long i = 1; i <= 100; i++) {
        assertEquals(new Long(i), models.get((int) i - 1).getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:12,代碼來源:SimpleExtendedModelTests.java


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