Bug in EntityGraph-API?

h.binder@...
 

Hi.

When creating EntityGraphs using the static metamodel, it seems to me that there's a flaw in the generic type API, specifically in the addSubgraph() methods. Those methods can't really be used on PluralAttributes because of a mismatch in the type parameters. For more explanation and a proposed solution see e.g. https://stackoverflow.com/questions/45409305/jpa-entitygraph-create-subgraph-of-pluralattribute-programmably-by-using-static.

I noticed that at least EclipseLink *implements* the method correctly, not without violating (via unchecked cast) the generic type of its signature from the API though.
Is this a bug, or a feature?

Sincerely,
 Hanno Binder

Join jpa-spec@javaee.groups.io to automatically receive all group messages.