Skip to content

Clarify behavior when both (named and provided query) are configured through @Query #1061

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

Closed
mp911de opened this issue Sep 28, 2021 · 1 comment
Assignees
Labels
type: enhancement A general enhancement

Comments

@mp911de
Copy link
Member

mp911de commented Sep 28, 2021

We should clarify what should happen when a query annotation is configured with a query and a named query:

@Query(value="select * from User", name = "User.findBySpringDataNamedQuery")

Right now, the provided string query is used. Ideally, we do something towards helping to understand that such a configuration creates ambiguity.

See also spring-projects/spring-data-jpa#2319.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 28, 2021
@christophstrobl christophstrobl added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 4, 2021
@mp911de
Copy link
Member Author

mp911de commented Oct 6, 2021

We use the declared query string and not named queries. Let's add a warn logging in that cases.

mp911de added a commit that referenced this issue Oct 6, 2021
…ry name.

We now log when a query method has an ambiguous declaration to clarify that the declared query is used.

Closes #1061.
mp911de added a commit that referenced this issue Oct 6, 2021
Reduce test element visibility according to JUnit 5 requirements.

See #1061
@mp911de mp911de closed this as completed in 09596ce Oct 6, 2021
mp911de added a commit that referenced this issue Oct 6, 2021
Reduce test element visibility according to JUnit 5 requirements.

See #1061
@mp911de mp911de added this to the 2.2.6 (2021.0.6) milestone Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants