GKS
GKS

Reputation: 319

Spring data rest: Adding JPA Criteria API queries in Spring Data Rest entity repository

I want to add JPA criteria api queries in repository which I have defined in my spring data rest demo. And then expose those queries using GET. Till now, I have not discovered, how to do the same. If anyone has done the same, any light on the same/ Sample code shall be much appreciated.

Thanks

Upvotes: 2

Views: 1084

Answers (1)

Stackee007
Stackee007

Reputation: 3244

Assuming you followed the conventions for custom methods all the custom methods are exposed as

[BASE_URI]/search/[CUSTOM_METHODS]

. Also there are little more constraints on these custom methods to exposed like all parameters to custom methods must be annotated with @Param. Optionally custom methods could return Page<?>, List<?> object and also can accept Pageable and Sort type params.

Upvotes: 1

Related Questions