Skip to content

Adding projection support for JPASpecificationExecutor #2499

@ratulSharker

Description

@ratulSharker

Hi there,

As per current situation, JPASpecificationExecutor does not allow select any result other than the entity.

Can we allow projection by adding following methods in the JPASpecificationExecutor and their implementation inside SimpleJpaRepository ?

public <Q> List<Q> findAll(Specification<T> specification, Class<Q> clazz);

public <Q> List<Q> findAll(Specification<T> specification, Sort sort, Class<Q> clazz);

public <Q> Page<Q> findAll(Specification<T> specification, Pageable pageable,
		Class<Q> clazz);

These methods will allow getting different result type other than T where T is JpaSpecificationExecutor<T>.

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