Skip to content

Query hint parameters in JpaSpecificationExecutor [DATAJPA-144] #569

Open
@spring-projects-issues

Description

@spring-projects-issues

Anssi Törmä opened DATAJPA-144 and commented

The Specification pattern is useful when complex specifications are combined from simple ones. However, query performance becomes an issue. Possibility to pass query hints to methods of JpaSpecificationExecutor would be very useful. That is, I would like something along these lines

JpaSpecificationExecutor.findAll(Specification<T>, List<QueryHint>)
JpaSpecificationExecutor.findAll(Specification<T>, Sort, List<QueryHint>)
…

where QueryHint is a name-value pair. Note that it must be possible to pass multiple hint values with the same name. For example "eclipselink.batch" -> "org.manager", "eclipselink.batch" -> "org.employees".

As a workaround, I've had to create my own JpaSpecificationExecutor with such methods using the source code in SimpleJpaRepository


7 votes, 6 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions