Embedded NamedAttributeNode not supported in NamedEntityGraph

Description

I'm trying to deploy an app to Wildfly 8.1.0 (Hibernate 4.3.5), but Hibernate AttributeNodeImpl is throwing an exception - "Attribute x is not a managed type". I looked at the code and it's checking for Basic or Embedded annotation on lines 123-128 and throwing an exception if found.

My attribute is Embedded. According to JPA spec, Entity, MappedSuperclass and Embeddable are all managed types. Also, online resources and the book "Pro JPA 2" provide examples of Entity Graphs with Embedded attribute nodes.

I've attached two classes which should reproduce the issue.

Attachments

2

Activity

Show:

Christian Beikov January 21, 2025 at 6:06 PM

Works fine on ORM 6

Johannes Berge November 25, 2020 at 3:16 PM
Edited

This issue seems fixed by newer versions of hibernate, but the required behaviour is still not working. See for what I mean with that.

Giovanni Lovato July 10, 2018 at 11:02 AM
Edited

I'm also affected with this, trying to tune my Spring repositories with entity graphs as described by many articles. I have an entity with an `@Embedded` field, which has an `@ElementCollection` field and I'm trying to fetch the collection with a graph, e.g.

but I'm getting

Ted Gulesserian October 7, 2017 at 5:46 PM

Adding the stackoverflow reference here. I ran into this issue today while trying to make my application more performant by using the @EntityGraph. I will add an eager fetch annotation in my entity for now. Hoping that eventually I will not have to do that indiscriminately.

https://stackoverflow.com/questions/27552445/jpa-subgraph-to-define-fetchtype-of-an-embedded-property

Steve Ebersole January 15, 2017 at 3:23 PM

I personally will not be tackling this until 6.0.

Attitude is one thing that will absolutely not help this move along. As far as where to look... I mean there is only one place in the codebase where EntityGraphs are applied and the exception stack trace shows you a great place to start looking.

Out of Date

Assignee

Unassigned

Reporter

Affects versions

Priority

Created July 23, 2014 at 4:39 PM
Updated January 21, 2025 at 6:06 PM
Resolved January 21, 2025 at 6:06 PM
Loading...