Skip to content

Support for Query by Example [DATAJPA-218] #572

Closed
@spring-projects-issues

Description

@spring-projects-issues

Joachim Sauer opened DATAJPA-218 and commented

We have a situation where (due to mapping to a legacy system) we occasionally find ourself using composite keys. Those keys are represented by dedicated ID DTOs (for example a FooIdDTO with the long properties barId and quuxId). Thus our repositories often contain methods that like findFooById(FooIdDTO id). While we do need to specify the query itself, it would be great if the mapping of the actual barId and quuxId values to the named parameters could be done in some declarative way instead of having to move the entire method implementation to a custom repository implementation. An alternative use case for this would be a bean that encapsulates a DB-based search: it's properties would "naturally" map onto the defined query, but it would still need to be written explicitly in a custom implementation.

I suspect that this feature would require support from Spring Data Common, but since our primary use case is in Spring Data JPA, I'm reporting it here


Issue Links:

  • DATACMNS-810 Add core types for Query By Example support
    ("depends on")
  • DATAJPA-844 Support for query-by-example in repositories
    ("is duplicated by")
  • DATAMONGO-1245 Add support for Query-By-Example

Referenced from: pull request #164

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions