Spring Data - ignore parameter if it has a null value

前端 未结 9 1546
暖寄归人
暖寄归人 2020-11-29 03:59

I want to have a spring data repository interface that takes two parameters. Is there a way to make it have the following behaviour?

MyObject findByParameter         


        
9条回答
  •  半阙折子戏
    2020-11-29 04:36

    Currently this is not possible in Spring-data-jpa.

    There is a JIRA ticket regarding this which is still under investigation by the Spring team.

    However if you want a workaround you can checkout a simple criteria query example.

提交回复
热议问题