-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fetch join using composite key on join entity fails to hydrate correctly #5762
Comments
I think the main cause of this bug is located in the The problem is that In this particular example, the The bug disappears when additional fields are added to I believe that the fundamental problem is that |
Fixed in #5975 |
An issue remains in 2.5.10. When using array hydration, the last joined entity in result set is not hydrated. I'm having the following entity:
Now I call this code:
And get this result:
Notice that the last skill in result set is not hydrated. When I use scalar hydration, all fields are returned correctly. When I add an additional field to JnChallengeSkill (as @jakestay did above), the last result gets hydrated properly as well. |
When doing a fetch join to hydrate an entity, using a join table with a composite key and no other defined fields, the hydration incorrectly creates duplicate associated entities.
This issue may possibly be related to #2548. I cannot find any more recent related bug reports.
Steps to reproduce:
Create these three entities and their corresponding database tables:
Populate the database tables with this data:
Use this code to hydrate a
Driver
entity and display its contents:Expected output:
John Doe:
BMW 7 Series
Crysler 300
Dodge Dart
Mercedes C-Class
Volvo XC90
Actual output:
John Doe:
BMW 7 Series
Dodge Dart
Dodge Dart
Volvo XC90
Volvo XC90
There is a strange duplication going on here with the associated entities. Note that the problem disappears if there are additional fields defined in the join entity (
DriverRide
), or if all the associated entities (Car
) have already been previously loaded from the database.The text was updated successfully, but these errors were encountered: