Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

EmbeddedResourcesAssembler fetches lazy-loaded associations unnecessarily #2520

Open
Assignees
@bgiddens

Description

Consider an entity with a lazy-loaded one-to-many association, and a simple shallow projection that excludes the association. When retrieving the entity collection with the shallow projection, we would hope and expect that the association is never loaded.

In practice, SDR forces loading of the association via the EmbeddedResourcesAssembler's getEmbeddedResources method. This can become a significant performance problem in complex entity networks with many associations and large-scale one-to-many relationships.

I am not 100% clear on the scope of responsibility of the the EmbeddedResourcesAssembler (does it assemble association links, nested response models, or both?), but it is clearly aware of the projection context via its projector member. It can use this to check if the actual value of the association is needed in the projection. If not, then the property fetch done here and the subsequent collection processing can be skipped; all that should be needed is a link to the relevant relation endpoint.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /