"org.hibernate.QueryException: could not resolve property" in JBoss EAP 6
Issue
- Three entities are linked by association
TestClass1owns aOneToOneassociation withTestClass2(throughtestClass2)TestClass2owns aOneToManyassociation withTestClass3(throughtestClass3Set)
- A subquery with an implicit join included as a second condition in an outer query fails:
String query = "from TestClass1 as testClass1 where " +
"testClass1.testClass2.title='test2' and " +
"exists (from testClass1.testClass2.testClass3Set as testClass3 where testClass3.name = 'test3first')";
List a = hibernateSession.createQuery(query).list();
... org.hibernate.QueryException: could not resolve property: name of: TestClass2
at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:83)
at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:77)
...
- See HHH-9090 for additional description and testcase.
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6
- Hibernate 4
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
