agrestio / agrest

Server-side Java REST Framework for easy access to data graphs from various backends
https://agrest.io
Apache License 2.0
80 stars 34 forks source link

GET with includes can't match children to parent when parent has a compound key #684

Closed andrus closed 1 month ago

andrus commented 1 month ago

This seems to be fixed in 5.x, but in 4.x, there is an issue with nested fetches when a root entity has two or more PK columns. It may work coincidentally depending on those column names, but it breaks in a general case, because when reading child query results, parent keys are placed in the wrong positions.

The observed behavior is null related objects where there should be non-null objects.

andrus commented 1 month ago

Ported tests from 4.x, and indeed this was fixed as early as 5.0.M1, as a side effect of #521