Skip to content
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

Need another property to make lazy loading of attributes easy with entity graphs #65

Closed
lukasj opened this issue Aug 31, 2013 · 4 comments · Fixed by #454
Closed

Need another property to make lazy loading of attributes easy with entity graphs #65

lukasj opened this issue Aug 31, 2013 · 4 comments · Fixed by #454

Comments

@lukasj
Copy link
Contributor

lukasj commented Aug 31, 2013

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.

@lukasj
Copy link
Contributor Author

lukasj commented Aug 31, 2013

@glassfishrobot Commented
Reported by mkeith

@lukasj
Copy link
Contributor Author

lukasj commented May 5, 2017

@glassfishrobot Commented
This issue was imported from java.net JIRA JPA_SPEC-65

@lukasj
Copy link
Contributor Author

lukasj commented Aug 31, 2018

@gavinking
Copy link
Contributor

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.

@lukasj lukasj added this to To do in 3.2.0 via automation Aug 21, 2023
3.2.0 automation moved this from To do to Done Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
3.2.0
Done
Development

Successfully merging a pull request may close this issue.

2 participants