Skip to content

findById throws org.springframework.dao.InvalidDataAccessApiUsageException "only except projection" #23

@barryspearce

Description

@barryspearce

Upgrading from 2.0.1 to 2.0.2 caused significant breaking issues across my repositories:

I had to remove every single one of my methods from every single repository that I had included:

<T> Optional<T> findById(Long id, Class<T> type);

However, whereas the Spring implementation works flawlessly, the JpaSpecificationExecutorWithProjection version throws an exception every single time across multiple projects:

org.springframework.dao.InvalidDataAccessApiUsageException: only except projection; nested exception is java.lang.IllegalArgumentException: only except projection

Coupled with the introduction of forcing an Id field (another issue). This makes 2.0.2 unusable

Why has findById been implemented when Spring itself provides perfectly adequate accurate implementation as standard?
Duplication of spring code would be unwise.
This appears to be feature creep beyond providing Execution of specifications with projections.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions