我在jooq中遇到了与batchDelete相关的问题。我在下面的代码中有一个列表folderProcessChecklistRecordList,但是问题是将列表转换为UpdatableRecord。因为batchDelete参数需要UpdatableRecord。

错误:


  事务类型中的方法batchDelete(UpdatableRecord ...)
  不适用于参数
  (清单)


代码在这里:

public void deleteFolderProcessChecklist(String folderType, List<FolderProcessChecklistRecord> folderProcessChecklistRecordList) throws ProcessCheckListException{

        if(UserSubject.current().hasPermission(folderType, ButtonPermissionCode.FOLDER_PROCESS_CHECKLIST_DELETE)){
            Transaction.current().batchDelete(folderProcessChecklistRecordList));
        }else{
            throw new ProcessCheckListException();
        }
    }


谁能告诉我:

如何将列表转换为可更新记录?

最佳答案

这里有两个潜在的问题:

您的记录根本不是UpdatableRecord

您确定您的FolderProcessChecklistRecordUpdatableRecord吗?否则,您将无法将其传递给任一batchDelete()方法

您的Transaction.current()对象未实现所有DSLContext

jOOQ带有重载的DSLContext.batchDelete()方法:


batchDelete(UpdatableRecord...)
batchDelete(Collection<? extends UpdatableRecord<?>>)


other questions (by your coworkers?),我怀疑您的自定义Transaction类型可能无法正确实现DSLContext

关于java - 如何将列表转换为UpdatableRecord?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/20119215/

10-12 20:06