-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Unable to perform a count operation on a named query #10319
Comments
cc @Sanne |
I'll pass it to @FroMage :) |
Yeah, the way we handle them is not by replacing the body of the method with the text of the query, but just passing it on to ORM, which doesn't support that. Now, granted, in some cases we could actually make this work by using the named query text itself and applying the same transformation we do for regular queries to be able to count them. @loicmathieu since you did the named queries, would you be interested in looking at this? |
I can have a look. Another implementation would be to offer the user a way to pass it's own countQuery, but this will defeat the simplicity of Panache regarding the |
io.quarkus.panache.common.exception.PanacheQueryException: The named query must be defined on your JPA entity or one of its super classes. Does anyone know how to fix this? |
if yes please let me know. |
@GithubSre this means that the named query annotation was not found. This issue is closed, please ask on stackoverfow or Zulip for help or open a new issue with a reproducer. |
thanks @loicmathieu |
this helped solve the problem. |
This is probably less of a bug and more of a gap in my Hibernate/HQL knowledge. Basically my named query works with
find
but throws when I addcount
.The immediate workaround to use the query directly:
Java 14
Quarkus 1.5.2
The text was updated successfully, but these errors were encountered: