gpt4 book ai didi

java - 如何将列表转换为UpdatableRecord?

转载 作者:太空宇宙 更新时间:2023-11-04 07:14:45 25 4
gpt4 key购买 nike

我在 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

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

您的Transaction.current()对象没有实现 DSLContext 的全部

jOOQ 发货时已重载 DSLContext.batchDelete()方法:

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

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com