-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: EntityGraph usage
PostPosted: Wed Mar 12, 2014 11:18 pm 
Newbie

Joined: Wed Mar 12, 2014 11:05 pm
Posts: 1
I have a general usage question regarding EntityGraphs, and specifically Hibernate's implementation.

The JPA specification, as codified by the EntityGraph<T> interface, specifies that an IllegalArgumentException is thrown if an attribute that is not an attribute of the entity type is being added: http://docs.jboss.org/hibernate/jpa/2.1/api/javax/persistence/EntityGraph.html#addAttributeNodes(java.lang.String...)

However, it is unclear from the specification if it is legal to add inherited attributes, or not.
For example: If Entity type E1 defines an attribute a1 and entity type E2 extends E1, is it legal to add a1 as an attribute to EntityGraph<E2>?

The Hibernate implementation throws an IllegalArgumentException if an inherited attribute is being added. Looking at the Hibernate code base, the implementation resolves attribute names using only those attributes directly declared by the entity type.

If this behavior conforms to the JPA specification then how is one supposed to add superclass attributes?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.