java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [managers] on this ManagedType [org.hibernate.jpa.test.graphs.queryhint.QueryHintEntityGraphTest$Manager]

Hibernate JIRA | Brett Meyer | 3 years ago
  1. 0

    {code} @Entity private static class Company implements Serializable { @Id @GeneratedValue public long id; @OneToMany public Set<Employee> employees; } @Entity @Inheritance( strategy = InheritanceType.TABLE_PER_CLASS ) private static class Employee { @Id @GeneratedValue public long id; @ManyToMany public Set<Manager> managers; } @Entity private static class Manager extends Employee { } {code} {code} Subgraph<Employee> subgraph1 = entityGraph.addSubgraph( "employees" ); subgraph1.addAttributeNodes( "managers" ); Subgraph<Employee> subgraph2 = subgraph1.addSubgraph( "managers" ); subgraph2.addAttributeNodes( "managers" ); {code} {code} java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [managers] on this ManagedType [org.hibernate.jpa.test.graphs.queryhint.QueryHintEntityGraphTest$Manager] at org.hibernate.jpa.internal.metamodel.AbstractManagedType.checkNotNull(AbstractManagedType.java:144) at org.hibernate.jpa.internal.metamodel.AbstractManagedType.getDeclaredAttribute(AbstractManagedType.java:137) at org.hibernate.jpa.graph.internal.SubgraphImpl.resolveAttribute(SubgraphImpl.java:124) at org.hibernate.jpa.graph.internal.AbstractGraphNode.buildAttributeNode(AbstractGraphNode.java:119) at org.hibernate.jpa.graph.internal.AbstractGraphNode.addAttribute(AbstractGraphNode.java:114) at org.hibernate.jpa.graph.internal.AbstractGraphNode.addAttributeNodes(AbstractGraphNode.java:109) at org.hibernate.jpa.graph.internal.SubgraphImpl.addAttributeNodes(SubgraphImpl.java:62) at org.hibernate.jpa.test.graphs.queryhint.QueryHintEntityGraphTest.testQueryHintEntityGraph(QueryHintEntityGraphTest.java:81) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74) {code}

    Hibernate JIRA | 3 years ago | Brett Meyer
    java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [managers] on this ManagedType [org.hibernate.jpa.test.graphs.queryhint.QueryHintEntityGraphTest$Manager]
  2. 0
    Properties of subclasses may have to be referenced in a different way. More on this here: https://goo.gl/FvnBXb
    via goo.gl
  3. 0

    Spring Data JPA and Generics

    Stack Overflow | 8 months ago | delewis
    java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [encounter] on this ManagedType [com.iimassociates.distiller.domain.EncounterPDFExport]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    How to join two tables using JPA Criteria Builder?

    Stack Overflow | 7 months ago | Nicolas Ding
    java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [student] on this ManagedType [School]
  6. 0

    Locate many to many extra relationship attribute with Spring data

    Stack Overflow | 1 year ago | luca
    java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [isRead] on this ManagedType [com.domain.NotificationHasUser]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Unable to locate Attribute with the the given name [managers] on this ManagedType [org.hibernate.jpa.test.graphs.queryhint.QueryHintEntityGraphTest$Manager]

      at org.hibernate.jpa.internal.metamodel.AbstractManagedType.checkNotNull()
    2. org.hibernate.jpa
      QueryHintEntityGraphTest.testQueryHintEntityGraph
      1. org.hibernate.jpa.internal.metamodel.AbstractManagedType.checkNotNull(AbstractManagedType.java:144)
      2. org.hibernate.jpa.internal.metamodel.AbstractManagedType.getDeclaredAttribute(AbstractManagedType.java:137)
      3. org.hibernate.jpa.graph.internal.SubgraphImpl.resolveAttribute(SubgraphImpl.java:124)
      4. org.hibernate.jpa.graph.internal.AbstractGraphNode.buildAttributeNode(AbstractGraphNode.java:119)
      5. org.hibernate.jpa.graph.internal.AbstractGraphNode.addAttribute(AbstractGraphNode.java:114)
      6. org.hibernate.jpa.graph.internal.AbstractGraphNode.addAttributeNodes(AbstractGraphNode.java:109)
      7. org.hibernate.jpa.graph.internal.SubgraphImpl.addAttributeNodes(SubgraphImpl.java:62)
      8. org.hibernate.jpa.test.graphs.queryhint.QueryHintEntityGraphTest.testQueryHintEntityGraph(QueryHintEntityGraphTest.java:81)
      8 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:601)
      4 frames
    4. JUnit
      FrameworkMethod.invokeExplosively
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      3 frames
    5. A Hibernate O/RM Module
      ExtendedFrameworkMethod.invokeExplosively
      1. org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63)
      1 frame
    6. JUnit
      FailOnTimeout$StatementThread.run
      1. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      2. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      3. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      4. org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
      4 frames