"JpaSpecificationExecutor" micronaut 的替代品是什么?
What is micronaut's alternative for "JpaSpecificationExecutor"?
我想要动态过滤查询。例子
/api/users?name=xyz
/api/users?name=xyz&email=abc
通过 spring 引导,可以使用 JpaSpecificationExecutor,我可以在其中传递自定义“规范”。如何使用 micronaut-data 做到这一点?
您可以将类似的 类 与 Microout Data 的 JPA specifications.
一起使用
Based on the same concept as Spring Data, when you need to create queries dynamically by composing JPA criteria then you can implement the JpaSpecificationExecutor
interface which provides multiple methods that receive an instance of Specification
which can be used in combination with existing repository interfaces.
我想要动态过滤查询。例子
/api/users?name=xyz
/api/users?name=xyz&email=abc
通过 spring 引导,可以使用 JpaSpecificationExecutor,我可以在其中传递自定义“规范”。如何使用 micronaut-data 做到这一点?
您可以将类似的 类 与 Microout Data 的 JPA specifications.
一起使用Based on the same concept as Spring Data, when you need to create queries dynamically by composing JPA criteria then you can implement the
JpaSpecificationExecutor
interface which provides multiple methods that receive an instance ofSpecification
which can be used in combination with existing repository interfaces.