本文整理汇总了Java中com.j256.ormlite.dao.RuntimeExceptionDao.delete方法的典型用法代码示例。如果您正苦于以下问题:Java RuntimeExceptionDao.delete方法的具体用法?Java RuntimeExceptionDao.delete怎么用?Java RuntimeExceptionDao.delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.j256.ormlite.dao.RuntimeExceptionDao
的用法示例。
在下文中一共展示了RuntimeExceptionDao.delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteOldICals
import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
private void deleteOldICals(RuntimeExceptionDao<ICal, Long> iCalDao)
{
DeleteBuilder<ICal, Long> deleteBuilder = iCalDao.deleteBuilder();
try {
deleteBuilder.where().lt("end", System.currentTimeMillis());
iCalDao.delete(deleteBuilder.prepare());
} catch (SQLException e) {
e.printStackTrace();
}
}
示例2: clearDao
import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
private void clearDao(RuntimeExceptionDao<ICal, Long> iCalDao)
{
List<ICal> retrievedICals = iCalDao.queryForAll();
for(ICal i : retrievedICals)
{
iCalDao.delete(i);
}
}
示例3: deleteDataFormDatabase
import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
private void deleteDataFormDatabase(BlackList entity) {
RuntimeExceptionDao<BlackList, Integer> dao = getDBHelper().getBlackListDao();
int result = dao.delete(entity);
if (result == 1) {
Toast.makeText(getActivity(), "删除成功", Toast.LENGTH_SHORT).show();
}
}
示例4: delete
import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
@Override
public <T> void delete(final T object) {
if (!(object instanceof OrmLiteModel)) {
throw new IllegalArgumentException("Only OrmLiteModel instances are supported.");
}
RuntimeExceptionDao dao = getRuntimeExceptionDao(object.getClass());
dao.delete(object);
}
示例5: deleteItem
import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
public static int deleteItem(Item item) {
RuntimeExceptionDao<Item, UUID> itemDao = DsaTabApplication.getInstance().getDBHelper().getItemDao();
int result = itemDao.delete(item);
for (ItemSpecification itemSpec : item.getSpecifications()) {
RuntimeExceptionDao itemSpecDao = DsaTabApplication.getInstance().getDBHelper()
.getRuntimeDao(itemSpec.getClass());
itemSpecDao.delete(itemSpec);
}
DsaTabApplication.getInstance().getContentResolver().notifyChange(ITEMS_URI,null);
return result;
}