Reputation: 1682
We are using the Spring Data JPA for database access. Our repositories contain basic query methods. What we want to do now is to use the Specification-Interface (criteria API) combined with complex query methods (like findByName(Specification spec)
). The problem is that these two ways block each other out (since there are two where
queries now). Is there any way to do this, like telling JPA to combine the two where
parts with AND
? The reason we want to do this is because some parts of the where
query are essential for every query. They should be defined in the name of the query method. The Specification only should contain individual criterias for individual use-cases.
Or is there any other way to solve this?
Upvotes: 1
Views: 674
Reputation: 83081
Currently this is not supported. Please feel free to raise a JIRA issue if you think this would be a worthwhile enhancement.
Upvotes: 1