-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Empty attributePaths on @EntityGraph produces exception #3682
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged
label
Nov 17, 2024
Thank you for the heads up @lbruun. True, you could have a entity graph without any attributes. |
christophstrobl
added
type: bug
A general bug
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Nov 19, 2024
christophstrobl
changed the title
Bug: Empty attributePaths on @EntityGraph produces exception
Empty attributePaths on @EntityGraph produces exception
Nov 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From how I understand the JPA specs there would be nothing wrong with the following Spring Data JPA annotation:
The purpose would be to create a query using an entity graph with no attributes added. Perfectly legal in JPA. (and indeed a valid use case)
However, with Spring Data JPA this is not possible as class
JpaEntityGraph
uses the following (flawed?) logic to distinguish between dynamic and static named graphs:Therefore, the query result in an exception :
This is wrong. The entity graph is indeed dynamic. It just happens to be an entity graph with no attributes added.
Another way to phrase the problem is that putting this on a query method in a Spring Data repo:
should NOT result in an exception, but should result in a query being performed using an JPA entity graph with no attributes added. Alternatively, please provide another way to achieve the goal.
Thanks.
The text was updated successfully, but these errors were encountered: