Project
IntelliJ IDEA
Priority
Normal
Type
Bug
Fix versions
No Fix versions
State
Fixed
Assignee
Peter Gromov
Subsystem
Code Analysis. Inspection
Affected versions
No Affected versions
Fixed in build
108.65  
  • Created by   David Beutel
    4 years ago (23 Jan 2008 22:13)
  • Updated by   root
    2 years ago (17 Jan 2010 20:57)
  • Jira: IDEADEV-24427
    (history, comments)
 
IDEA-42582 HQL: bogus error on order by selected attribute
1
Issue is visible to: All Users
  The issue is visible to the selected user group only
I've just started using HQL in 7.0.2 and I'm impressed by the support, especially the static analysis that a String parameter to a Spring method is HQL. I am seeing one little problem with it, though:

String hql = "select r.roleName from Application app inner join app.accounts acc inner join acc.roles r "
+ "where app.appName = :appName group by r.roleName order by r.roleName";
return (Collection<String>) getHibernateTemplate().findByNamedParam( hql, "appName", appName);

IDEA shows an error on the r.roleName following order by: "Orderable attribute of the entity being selected expected". But it doesn't really seem to be an error. It works as you'd expect, and there are similar examples from the Hibernate documentation (chapter 14, HQL):

select count(payment), status.name
from Payment as payment
join payment.currentStatus as status
where payment.status.name <> PaymentStatus.AWAITING_APPROVAL
or payment.statusChanges[ maxIndex(payment.statusChanges) ].user <> :currentUser
group by status.name, status.sortOrder
order by status.sortOrder

Environment: Windows XP, JDK 1.6.0_03, Hibernate 3.2.4 SP1, Hibernate annotations 3.3.0, Spring 2.5

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