我在 jooq 中遇到了与批量删除相关的问题。我在下面给出的代码中有一个列表 folderProcessChecklistRecordList
。但问题是将列表转换为 UpdatableRecord
。因为batchDelete参数需要 UpdatableRecord 。
错误:
The method batchDelete(UpdatableRecord...) in the type Transaction is not applicable for the arguments (List)
代码在这里:
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
您确定您的 FolderProcessChecklistRecord
是 UpdatableRecord
?否则,您无法将其传递给 batchDelete()
方法
您的Transaction.current()
对象没有实现 DSLContext
的全部
jOOQ 发货时已重载 DSLContext.batchDelete()
方法:
来自other questions (by your coworkers?) ,我怀疑你的自定义Transaction
类型可能无法正确实现 DSLContext
.
我是一名优秀的程序员,十分优秀!