persistence icon indicating copy to clipboard operation
persistence copied to clipboard

EntityGraph API has unspecified List/Map getters

Open lukasj opened this issue 12 years ago • 4 comments

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.

lukasj avatar Aug 27 '13 04:08 lukasj

  • Issue Imported From: https://github.com/javaee/jpa-spec/issues/64
  • Original Issue Raised By:@glassfishrobot
  • Original Issue Assigned To: Unassigned

lukasj avatar Aug 31 '18 16:08 lukasj

@glassfishrobot Commented Reported by mkeith

lukasj avatar Aug 27 '13 04:08 lukasj

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

lukasj avatar May 05 '17 06:05 lukasj

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.

gavinking avatar Aug 11 '23 16:08 gavinking