Skip to content

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

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 u.firstname from User u", countQuery = "select u.firstname from User u", name = "User.findBySpringDataNamedQuery", countProjection = "u.firstname")

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

@mp911de
Copy link
Member Author

mp911de commented Oct 4, 2021

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

@mp911de mp911de added this to the 2.5.6 (2021.0.6) milestone Oct 6, 2021
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 #2319
mp911de added a commit that referenced this issue Oct 6, 2021
Move off deprecated API.

See #2319
@mp911de mp911de closed this as completed in fa11454 Oct 6, 2021
mp911de added a commit that referenced this issue Oct 6, 2021
Move off deprecated API.

See #2319
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