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

    Spring Data JPA and Generics

    Stack Overflow | 6 months ago | delewis
    java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [encounter] on this ManagedType [com.iimassociates.distiller.domain.EncounterPDFExport]
  3. 0

    How to join two tables using JPA Criteria Builder?

    Stack Overflow | 5 months ago | Nicolas Ding
    java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [student] on this ManagedType [School]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Locate many to many extra relationship attribute with Spring data

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

    Could not create query metamodel for method public abstract java.util.Optional

    Stack Overflow | 1 month ago | Rick
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController' defined in file [/Users/rmann/Projects/HOA/spring-hoa/build/classes/main/com/latencyzero/hoa/UserController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Could not create query metamodel for method public abstract java.util.Optional com.latencyzero.hoa.UserRepository.findByLogin(java.lang.String)!

    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