Closed gavinking closed 1 year ago
The following code does not pass the typechecker:
var graph = em.createEntityGraph(Book.class); graph.addSubgraph(Book_.publisher); graph.addSubgraph(Book_.authors).addSubgraph(Author_.person);
So we need to add a method which lets us write:
var graph = em.createEntityGraph(Book.class); graph.addSubgraph(Book_.publisher); graph.addPluralSubgraph(Book_.authors).addSubgraph(Author_.person);
Its signature is:
<X> Subgraph<X> addPluralSubgraph(PluralAttribute<? extends T, ?, X> attribute)
and it needs to be declared on both EntityGraph and Subgraph.
EntityGraph
Subgraph
I had never noticed this oversight before, but actually it's pretty bad if you're trying to use the typesafe API.
Actually perhaps this should be called addElementSubgraph() to be more consistent with addKeySubgraph().
addElementSubgraph()
addKeySubgraph()
The following code does not pass the typechecker:
So we need to add a method which lets us write:
Its signature is:
and it needs to be declared on both
EntityGraph
andSubgraph
.I had never noticed this oversight before, but actually it's pretty bad if you're trying to use the typesafe API.