You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are currently two properties to use with entity graphs:
javax.persistence.fetchgraph -
This property accepts an entity graph to act as a complete override of all the attributes for the type. Attributes are dictated to be eager if included or lazy if excluded from the graph, regardless of how they are mapped.
javax.persistence.loadgraph -
This property offers a selective eager approach. One can simply add the attributes that one wants to be eagerly loaded and the rest are left as they are statically mapped.
The missing property would be something to allow more convenient selective lazy overriding without having to declare the entire attribute set for the type (as required by fetchgraph). So something like:
javax.persistence.lazygraph -
This property would offer a selective lazy approach. One would be able to add the attributes that one wants to be lazily loaded to the graph, with the rest being left as they are statically mapped.
The text was updated successfully, but these errors were encountered:
So, one of the things proposed in #454 is removeAttributeNode(), which lets you do exactly what is proposed here, that is:
add the attributes that one wants to be lazily loaded to the graph
To me, this seems a much better approach than adding another stringly-typed hint with another cryptic name. I already find the whole "fetchgraph" / "loadgraph" thing incredibly confusing (not to mention very lacking in typesafety), and I don't think adding "lazygraph" is going to improve that situation at all.
Instead, I'm hoping that we can agree on something quite close to what I've proposed in #454, which essentially deemphasizes "fetch" graphs in favor of making "load" graphs more flexible by letting you selectively remove nodes.
There are currently two properties to use with entity graphs:
javax.persistence.fetchgraph -
This property accepts an entity graph to act as a complete override of all the attributes for the type. Attributes are dictated to be eager if included or lazy if excluded from the graph, regardless of how they are mapped.
javax.persistence.loadgraph -
This property offers a selective eager approach. One can simply add the attributes that one wants to be eagerly loaded and the rest are left as they are statically mapped.
The missing property would be something to allow more convenient selective lazy overriding without having to declare the entire attribute set for the type (as required by fetchgraph). So something like:
javax.persistence.lazygraph -
This property would offer a selective lazy approach. One would be able to add the attributes that one wants to be lazily loaded to the graph, with the rest being left as they are statically mapped.
The text was updated successfully, but these errors were encountered: