I have a employee class that is a child of person where person has a collection of periodAddress
Code:
* @hibernate.bag
* table="periodAddress"
* lazy="true"
* cascade="all-delete-orphan"
* order-by="start"
* @hibernate.collection-one-to-many
* class="com.ccg.domain.PeriodAddress"
* @hibernate.collection-key
* column="personId
PeriodAddress then has a TEALookup object
Code:
* @hibernate.property
* class="com.ccg.domain.TEALookup"
* not-null="false"
* column="teaLookupId"
The TEALookup object has two properties an Integer and a Date
Code:
* @hibernate.property
* @hibernate.property
When I try to run this query
Code:
SELECT e.id FROM com.ccg.domain.Employee e LEFT JOIN e.periodAddresses.teaLookup t WHERE e.client.id =:clientId AND t.tEAResult =:maybeInt
I get the following exception
org.springframework.orm.hibernate.HibernateQueryException: expecting 'elements' or 'indices' after: teaLookup [SELECT e.id FROM com.ccg.domain.Employee e LEFT JOIN e.periodAddresses.teaLookup t WHERE e.client.id =:clientId AND t.tEAResult =:maybeInt];
Any help would greatly appreciated. Thanks.