Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repositories: Let Create Query by Example with Projection [DATAJPA-1162] #1499

Closed
spring-projects-issues opened this issue Aug 10, 2017 · 1 comment
Labels
status: superseded An issue that has been superseded by another

Comments

@spring-projects-issues
Copy link

Sébastien Laoût opened DATAJPA-1162 and commented

Given this interface:

/** Projection of any entity with a Long id field. */
public interface LongIdProjection {
    Long getId();
}

And this example entity:

public class My {
    public Long id;
    public String veryLongAndBoringString;
}

I'd like to create this automatically-generated query:

@Repository
public interface MyRepository extends JpaRepository<My, Long> {
    List<LongIdProjection> findAllIds(Example<My> example);
}

Unfortunately, I get this exception:

Caused by: org.springframework.data.mapping.PropertyReferenceException: No property findAllIds found for type My!

Could be cool to enable creating custom queries by examples that return a subset of properties of an entity, so we don't ask the database to return a lot of potentially big fields if we are only interested in one or two fields


Affects: 1.11.6 (Ingalls SR6)

1 votes, 2 watchers

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core support labels Dec 30, 2020
@mp911de
Copy link
Member

mp911de commented Jul 13, 2023

Fixed via #2294 (fluent query API for Query by Example)

@mp911de mp911de closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2023
@mp911de mp911de added status: superseded An issue that has been superseded by another and removed in: core Issues in core support type: enhancement A general enhancement labels Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

3 participants