Hi, could anyone tell me what's wrong with this query pls?
Code:
<query name="Offer.linkedConditions">
<![CDATA[ from ConditionValue c where c.conditionId in (select o.conditions.conditionId from OfferValue o where o.offerId = :offerId) ]]>
</query>
It works in 3.1, but I upgraded to 3.2 to get an unrelated bug fix, and the HQL isn't valid any more. I used the new antlr 2.7.6 and tried both query parsers mentioned in the migration guide. I've tried lots of variations based on the docs but I can't get it to work in 3.2. BTW it's definately a problem with the subselect.
Here're the mappings:
Code:
<class name="com.lsb.uk.mqs.value.OfferValue" table="MORTGAGE_OFFER">
<id name="offerId" column="OFFER_ID" unsaved-value="0">
<generator class="sequence">
<param name="sequence">OFFER_ID_SEQ</param>
</generator>
</id>
<property name="applicationId" column="APPLICATION_ID"/>
<property name="offerDate" column="OFFER_MADE_ON"/>
<property name="buildingInsurance" column="BUILDINGS_INSURANCE" type="nullint"/>
<property name="response" column="RESPONSE" type="nullint"/>
<property name="responseDate" column="RESPONSE_DATE"/>
<property name="revised" column="REVISED" type="nullboolean"/>
<property name="revisedDate" column="REVISED_DATE"/>
<property name="completed" column="COMPLETED" type="nullboolean"/>
<property name="completedDate" column="COMPLETED_DATE"/>
<property name="rejectedDate" column="REJECTED_DATE"/>
<property name="lastUpdateDate" column="LAST_MODIFIED_ON"/>
<property name="lastUpdateUser" column="LAST_MODIFIED_BY"/>
<bag name="conditions" table="MORTGAGE_OFFER_CONDITION" lazy="true">
<key column="OFFER_ID"/>
<many-to-many class="com.lsb.uk.mqs.value.ConditionValue"
column="CONDITION_ID"/>
</bag>
</class>
<class name="com.lsb.uk.mqs.value.ConditionValue" table="CONDITIONS">
<id name="conditionId" column="ID" unsaved-value="0">
<generator class="sequence">
<param name="sequence">offer_conditions_seq</param>
</generator>
</id>
<property name="condition" column="DESCRIPTION"/>
<property name="country" column="COUNTRY"/>
<property name="lastUpdateUser" column="LAST_MODIFIED_BY"/>
<property name="lastUpdateDate" column="LAST_MODIFIED_ON"/>
</class>
Thanks