"org.hibernate.QueryException: could not resolve property" in JBoss EAP 6

Solution Verified - Updated -

Issue

  • Three entities are linked by association
    • TestClass1 owns a OneToOne association with TestClass2 (through testClass2)
    • TestClass2 owns a OneToMany association with TestClass3 (through testClass3Set)
  • 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.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.