How to convert list into UpdatableRecord?

情到浓时终转凉″ 提交于 2019-12-13 00:14:09

问题


I have issue related batchDelete in jooq. I have a list folderProcessChecklistRecordListin 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!