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


Java SugarRecord.findAsIterator方法代碼示例

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


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

示例1: findAsIteratorTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void findAsIteratorTest() throws Exception {
    for (int i = 1; i <= 100; i++) {
        save(new SimpleExtendedModel());
    }
    Iterator<SimpleExtendedModel> cursor = SugarRecord.findAsIterator(SimpleExtendedModel.class,
            "id >= ?", "50");
    for (int i = 50; i <= 100; i++) {
        assertTrue(cursor.hasNext());
        SimpleExtendedModel model = cursor.next();
        assertNotNull(model);
        assertEquals(new Long(i), model.getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:15,代碼來源:SimpleExtendedModelTests.java

示例2: findAsIteratorOutOfBoundsTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test(expected=NoSuchElementException.class)
public void findAsIteratorOutOfBoundsTest() throws Exception {
    save(new SimpleExtendedModel());
    Iterator<SimpleExtendedModel> cursor = SugarRecord.findAsIterator(SimpleExtendedModel.class,
            "id = ?", "1");
    assertTrue(cursor.hasNext());
    SimpleExtendedModel model = cursor.next();
    assertNotNull(model);
    assertEquals(new Long(1), model.getId());
    // This should throw a NoSuchElementException
    cursor.next();
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:13,代碼來源:SimpleExtendedModelTests.java

示例3: disallowRemoveCursorTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test(expected=UnsupportedOperationException.class)
public void disallowRemoveCursorTest() throws Exception {
    save(new SimpleExtendedModel());
    Iterator<SimpleExtendedModel> cursor = SugarRecord.findAsIterator(SimpleExtendedModel.class,
            "id = ?", "1");
    assertTrue(cursor.hasNext());
    SimpleExtendedModel model = cursor.next();
    assertNotNull(model);
    assertEquals(new Long(1), model.getId());
    // This should throw a UnsupportedOperationException
    cursor.remove();
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:13,代碼來源:SimpleExtendedModelTests.java

示例4: findAsIteratorTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void findAsIteratorTest() throws Exception {
    for (int i = 1; i <= 100; i++) {
        save(new SimpleAnnotatedModel());
    }
    Iterator<SimpleAnnotatedModel> cursor = SugarRecord.findAsIterator(SimpleAnnotatedModel.class,
            "id >= ?", "50");
    for (int i = 50; i <= 100; i++) {
        assertTrue(cursor.hasNext());
        SimpleAnnotatedModel model = cursor.next();
        assertNotNull(model);
        assertEquals(new Long(i), model.getId());
    }
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:15,代碼來源:SimpleAnnotatedModelTests.java

示例5: findAsIteratorOutOfBoundsTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test(expected=NoSuchElementException.class)
public void findAsIteratorOutOfBoundsTest() throws Exception {
    save(new SimpleAnnotatedModel());
    Iterator<SimpleAnnotatedModel> cursor = SugarRecord.findAsIterator(SimpleAnnotatedModel.class,
            "id = ?", "1");
    assertTrue(cursor.hasNext());
    SimpleAnnotatedModel model = cursor.next();
    assertNotNull(model);
    assertEquals(new Long(1), model.getId());
    // This should throw a NoSuchElementException
    cursor.next();
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:13,代碼來源:SimpleAnnotatedModelTests.java

示例6: disallowRemoveCursorTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test(expected=UnsupportedOperationException.class)
public void disallowRemoveCursorTest() throws Exception {
    save(new SimpleAnnotatedModel());
    Iterator<SimpleAnnotatedModel> cursor = SugarRecord.findAsIterator(SimpleAnnotatedModel.class,
            "id = ?", "1");
    assertTrue(cursor.hasNext());
    SimpleAnnotatedModel model = cursor.next();
    assertNotNull(model);
    assertEquals(new Long(1), model.getId());
    // This should throw a UnsupportedOperationException
    cursor.remove();
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:13,代碼來源:SimpleAnnotatedModelTests.java

示例7: iterator

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Override
public Iterator<T> iterator() {
    if (arguments == null) {
        arguments = convertArgs(args);
    }

    return SugarRecord.findAsIterator(record, whereClause, arguments, groupBy, orderBy, limit);
}
 
開發者ID:JusticeRage,項目名稱:ApkTrack,代碼行數:9,代碼來源:Select.java


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