Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Last commented by a user?:
      true

      Description

      	@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 {
      	}
      
      		Subgraph<Employee> subgraph1 = entityGraph.addSubgraph( "employees" );
      		subgraph1.addAttributeNodes( "managers" );
      		Subgraph<Employee> subgraph2 = subgraph1.addSubgraph( "managers" );
      		subgraph2.addAttributeNodes( "managers" );
      
      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)
      

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: