Cosium / spring-data-jpa-entity-graph

Spring Data JPA extension allowing full dynamic usage of EntityGraph on repositories
MIT License
466 stars 51 forks source link

Expose method `findBy(Specification<T> spec, Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction, EntityGraph entityGraph)` in EntityGraphJpaSpecificationExecutor #123

Open sisimomo opened 10 months ago

sisimomo commented 10 months ago

Issue Description: A new method, findBy(Specification<T> spec, Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction), has been introduced in the JPA (since 3.0.x) repository interface called JpaSpecificationExecutor. This method enhances the flexibility of querying by allowing users to define custom queries using specifications and fluent query APIs. However, as of the current version of this library (3.0.1), this method has not been exposed for use by developers.

Expected Behavior: A new method findBy(Specification<T> spec, Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction, EntityGraph entityGraph) should be made accessible in the EntityGraphJpaSpecificationExecutor interface, thus enabling developers to leverage its capabilities to create more tailored and efficient queries when working with JPA repositories.

Steps to Reproduce: Since the method is not exposed, there is currently no way to directly demonstrate the issue. However, it can be confirmed by examining the EntityGraphJpaSpecificationExecutor interface and comparing its methods with the available ones in the JPA interface JpaSpecificationExecutor.

Impact: The absence of this method limits the query customization options available to developers when utilizing JPA repositories. By exposing this method, developers can take advantage of the advancements in query flexibility introduced in JPA 3.0.x and beyond.

Additional Information:

Proposed Solution: Expose the new method findBy(Specification<T> spec, Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction, EntityGraph entityGraph) in the EntityGraphJpaSpecificationExecutor interface so that developers can utilize it for creating custom queries with specifications and fluent query APIs.