问题
I have issue related batchDelete in jooq. I have a list folderProcessChecklistRecordList
in my code given below .But the issue is that convert list into UpdatableRecord
.Because of batchDelete argument required UpdatableRecord .
Error:
The method batchDelete(UpdatableRecord...) in the type Transaction is not applicable for the arguments (List)
Code here:
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();
}
}
Can anyone tell me:
How to convert the list into updatablerecord ?
回答1:
There are a couple of potential problems here:
Your record simply isn't an UpdatableRecord
Are you sure that your FolderProcessChecklistRecord
is an UpdatableRecord
? Otherwise, you couldn't pass it to either batchDelete()
method
Your Transaction.current()
object doesn't implement all of DSLContext
jOOQ ships with overloaded DSLContext.batchDelete()
methods:
- batchDelete(UpdatableRecord...)
- batchDelete(Collection<? extends UpdatableRecord<?>>)
From other questions (by your coworkers?), I suspect that your custom Transaction
type might not correctly implement DSLContext
.
来源:https://stackoverflow.com/questions/20119215/how-to-convert-list-into-updatablerecord