History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-25803
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Gregory Shrago
Reporter: Davide Baroncelli
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

Good query marked red in HQL console

Created: 10 Mar 08 20:24   Updated: 11 Apr 08 09:11
Component/s: J2EE.Hibernate
Fix Version/s: Diana 8375, Selena 7.0.4

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 7,744
Fixed in build: 8,287
Severity: Medium


 Description  « Hide
In the following query

select distinct alert.id from Alert as alert where alert.id in (select a.id from Alert a join a.clientImpacts as i where i.clientId like ?)

the HQL console marks the "i.clientId" property red with a tooltip on hover stating "cannot resolve expression". The mappings do indeed specify that property:

<class name="Alert" table="Alerts">
<id name="id" column="AlertId" type="integer">
<generator class="native"/>
</id>
<property name="actionLog" column="ActionLog" type="text"/>
[...]
<list name="clientImpacts" table="ClientImpacts">
<key column="AlertId"/>
<index column="clientImpactIndex"/>
<composite-element class="ClientImpact">
<property name="clientId" column="ClientId" type="string" not-null="true" length="64"/>
<many-to-one name="serviceType" column="ServiceTypeId" class="ServiceType"/>
<property name="value" column="ImpactValue" type="double"/>
<many-to-one name="impactType" column="ImpactTypeId" class="ImpactType"/>
</composite-element>
</list>
</class>
[...]

The HQL console itself correctly translates the query to SQL when asked:

> select distinct alert.id from Alert as alert where alert.id in (select a.id from Alert a join a.clientImpacts as i where i.clientId like ?)
SQL #1 types: integer
-----------------
select
distinct alert0_.AlertId as col_0_0_
from
Alerts alert0_
where
alert0_.AlertId in (
select
alert1_.AlertId
from
Alerts alert1_
inner join
ClientImpacts clientimpa2_
on alert1_.AlertId=clientimpa2_.AlertId
where
clientimpa2_.ClientId like ?
)



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.