-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Exception swallowed in CreateIfNotFoundQueryLookupStrategy.resolveQuery [DATAJPA-1723] #2018
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
Comments
Part of the problem is that @Override
protected RepositoryQuery resolveQuery(JpaQueryMethod method, QueryRewriter queryRewriter, EntityManager em,
NamedQueries namedQueries) {
try {
return lookupStrategy.resolveQuery(method, queryRewriter, em, namedQueries);
} catch (IllegalStateException e) {
return createStrategy.resolveQuery(method, queryRewriter, em, namedQueries);
}
} This method will catch an |
gregturn
added a commit
that referenced
this issue
May 18, 2022
By using exceptions for flow control, other critical exceptions are getting masked. The lack of a resolvable query should instead leverage some sort of null value object. Closes #2018.
gregturn
added a commit
that referenced
this issue
May 18, 2022
By using exceptions for flow control, other critical exceptions are getting masked. The lack of a resolvable query should instead leverage some sort of null value object. Closes #2018.
gregturn
added a commit
that referenced
this issue
May 18, 2022
By using exceptions for flow control, other critical exceptions are getting masked. The lack of a resolvable query should instead leverage some sort of null value object. See #2018.
gregturn
added a commit
that referenced
this issue
May 18, 2022
By using exceptions for flow control, other critical exceptions are getting masked. The lack of a resolvable query should instead leverage some sort of null value object. See #2018.
gregturn
added a commit
that referenced
this issue
May 18, 2022
By using exceptions for flow control, other critical exceptions are getting masked. The lack of a resolvable query should instead leverage some sort of null value object. See #2018.
Backported to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ckalan opened DATAJPA-1723 and commented
Exception thrown from lookupStrategy.resolveQuery() is swallowed without proper logging before falling back to createStrategy.
In my case it occured when I used
@Query
annotation in my repo method with "name" attribute pointing to a JPA Named Query declared on the entity. The problem was I also used Sort parameter and I got "propert not found for type ..." exception. In fact the inner exception was thrown by "NamedQueries" class with this code:It took me a couple of hours to identify the issue and I had to deep dive in the code because there was no debug log for the actual error. In addition to the logs, it might be a good idea to update the docs to mention this limitation.
Note that this happens in 2.2.6 RELEASE version that comes with Spring Boot but that version is not listed in the Affects Version/s field above.
No further details from DATAJPA-1723
The text was updated successfully, but these errors were encountered: