Project
IntelliJ IDEA
Priority
Normal
Type
Bug
Fix versions
No Fix versions
State
Fixed
Assignee
Gregory Shrago
Subsystem
J2EE.Hibernate
Affected versions
No Affected versions
Fixed in build
108.65  
  • Created by   Davide Baroncelli
    3 years ago (10 Mar 2008 21:24)
  • Updated by   root
    2 years ago (17 Jan 2010 20:58)
  • Jira: IDEADEV-25803
    (history, comments)
 
IDEA-43061 Good query marked red in HQL console
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
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 ?
)


Issue was resolved
Comments (0)
 
History
 
Linked Issues (?)
 
Issue has no comments