OrmProvider.java 文件源码

java
阅读 39 收藏 0 点赞 0 评论 0

项目:sorm 作者:
@Override
public ContentProviderResult[] applyBatch( ArrayList<ContentProviderOperation> operations )
        throws OperationApplicationException {

    ContentProviderResult[] contentProviderResults;
    try {
        getWritableDatabase().beginTransaction();
        contentProviderResults = new ContentProviderResult[operations
                .size()];

        int i = 0;
        for (ContentProviderOperation cpo : operations) {
            contentProviderResults[i] = cpo.apply(this, contentProviderResults, i);
            if(contentProviderResults[i] == null || (contentProviderResults[i].count == null && contentProviderResults[i].uri == null)){
                throw new DaoException();
            }
            i++;
        }
        getWritableDatabase().setTransactionSuccessful();
    } finally{
        if (getWritableDatabase().inTransaction()) {
            getWritableDatabase().endTransaction();
        }            
    }
    return contentProviderResults;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号