-
Notifications
You must be signed in to change notification settings - Fork 60
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
EntityGraph addAttributeNodes generic type incorrect #112
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@sebek64 Commented |
|
I would suggest that you make T an upper bound: My team ran into this issue with a MappedSuperClass that is inherited by two Entities. We would like to consolidate more code that can be shared, but losing the ability to write type safe entity graphs with generated metamodel classes is a show stopper. |
This is now being done as part of #424, so this one can probably be closed. |
The method in EntityGraph (and EntitySubgraph)
public void addAttributeNodes(Attribute<T, ?>... attribute);
should be
public void addAttributeNodes(Attribute... attribute);
since we should be able to write code like this
EntityGraph graph = em.createEntityGraph(SubEntity.class);
graph.addAttributeNodes(SubEntity_.baseEntityField);
yet currently it is a compiler error due to this generic type bug.
The same applies to other methods that refer to Attribute<T, ?>
The text was updated successfully, but these errors were encountered: