Closed fermentedDairy closed 6 months ago
Thank you for reporting this and providing the entity and repository classes. I have switched this issue from release bug
to bug
because it is beta function that is still in development. We will look into it to see what is going wrong.
Just a note, removing the foreign key relationship from both the bookstore and section JPA entity lead to the JPQL being generated correctly. For some reason the query generation code is using the wrong ID.
I reproduced the issue and located the problem in the code, which is a place where it is overwriting the id value. I fixed it locally and will look into getting the fix into the upcoming 24.0.0.5-beta
This should be corrected in the 24.0.0.5-beta
Description
When using the CrudRepository from Jakarta Data, the repositoryImpl generates the JPQL
SELECT o FROM Section o WHERE (o.bookstore.id=?1)
. trace.log extract:Steps to Reproduce
JPA entities and Repositories are attached as well as trace.log
Expected behavior
The expected JPQL is
SELECT o FROM Section o WHERE (id=?1)
. JPQL generated for attached Bookstore entity is as expected:SELECT o FROM Bookstore o WHERE (o.id=?1)
Diagnostic information:
JakartaData.zip