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


Java SugarRecord.deleteInTx方法代碼示例

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


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

示例1: deleteInTransactionFewTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void deleteInTransactionFewTest() throws Exception {
    SimpleExtendedModel first = new SimpleExtendedModel();
    SimpleExtendedModel second = new SimpleExtendedModel();
    SimpleExtendedModel third = new SimpleExtendedModel();
    save(first);
    save(second);
    save(third);
    assertEquals(3L, SugarRecord.count(SimpleExtendedModel.class));
    SugarRecord.deleteInTx(first, second, third);
    assertEquals(0L, SugarRecord.count(SimpleExtendedModel.class));
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:13,代碼來源:SimpleExtendedModelTests.java

示例2: deleteInTransactionManyTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void deleteInTransactionManyTest() throws Exception {
    List<SimpleExtendedModel> models = new ArrayList<>();
    for (int i = 1; i <= 100; i++) {
        SimpleExtendedModel model = new SimpleExtendedModel();
        models.add(model);
        save(model);
    }
    assertEquals(100L, SugarRecord.count(SimpleExtendedModel.class));
    SugarRecord.deleteInTx(models);
    assertEquals(0L, SugarRecord.count(SimpleExtendedModel.class));
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:13,代碼來源:SimpleExtendedModelTests.java

示例3: deleteInTransactionFewTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void deleteInTransactionFewTest() throws Exception {
    SimpleAnnotatedModel first = new SimpleAnnotatedModel();
    SimpleAnnotatedModel second = new SimpleAnnotatedModel();
    SimpleAnnotatedModel third = new SimpleAnnotatedModel();
    save(first);
    save(second);
    save(third);
    assertEquals(3L, SugarRecord.count(SimpleAnnotatedModel.class));
    SugarRecord.deleteInTx(first, second, third);
    assertEquals(0L, SugarRecord.count(SimpleAnnotatedModel.class));
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:13,代碼來源:SimpleAnnotatedModelTests.java

示例4: deleteInTransactionManyTest

import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void deleteInTransactionManyTest() throws Exception {
    List<SimpleAnnotatedModel> models = new ArrayList<>();
    for (int i = 1; i <= 100; i++) {
        SimpleAnnotatedModel model = new SimpleAnnotatedModel();
        models.add(model);
        save(model);
    }
    assertEquals(100L, SugarRecord.count(SimpleAnnotatedModel.class));
    SugarRecord.deleteInTx(models);
    assertEquals(0L, SugarRecord.count(SimpleAnnotatedModel.class));
}
 
開發者ID:skoumalcz,項目名稱:joogar,代碼行數:13,代碼來源:SimpleAnnotatedModelTests.java

示例5: removeFavourite

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


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