persistence
persistence copied to clipboard
EntityGraph API has unspecified List/Map getters
The List/Map getter methods (e.g. getAttributeNodes()) on EntityGraph, AttributeNode, and Subgraph do not specify whether the List/Map returned is a mutable one or a copy. They should be specified as returning the exact collections so the collections can be mutated. If it is a copy then the ability to mutate an existing named entity graph using createEntityGraph(String) is quite limited. There would be no way to remove an attribute node or a subgraph, or for that matter even add a subgraph for an existing attribute node.
The alternative to returning the actual collections is to add methods to the API to enable the additional mutating operations.
- Issue Imported From: https://github.com/javaee/jpa-spec/issues/64
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: Unassigned
@glassfishrobot Commented Reported by mkeith
@glassfishrobot Commented This issue was imported from java.net JIRA JPA_SPEC-64
There would be no way to remove an attribute node or a subgraph, or for that matter even add a subgraph for an existing attribute node.
This is at least partially addressed in #454.