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

Always provide access to child data at the RelatedResourceEntity level #627

Open andrus opened 1 year ago

andrus commented 1 year ago

When processing a select, depending on a resolver, child objects may or may not be stored in ResourceEntity. The default Cayenne strategy ("relatedViaQueryWithParentExp") actually stores them, while a few others like "relatedViaParentPrefetch" do not. This causes issues like #626.

We must change the resolver lifecycle, to unconditionally store children in their respective ResourceEntities, regardless of the how they were resolved. This will make the rest of the pipeline more sane, as well as simplify RelatedDataResolver itself.