本文整理匯總了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));
}
示例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));
}
示例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));
}
示例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));
}
示例5: removeFavourite
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Override
public void removeFavourite(Todo flight) {
SugarRecord.deleteInTx(flight);
}