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

Key: IDEADEV-24427
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Peter Gromov
Reporter: David Beutel
Votes: 1
Watchers: 1
Operations

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

HQL: bogus error on order by selected attribute

Created: 23 Jan 08 21:13   Updated: 24 Jan 08 13:51
Component/s: Code Analysis. Inspection
Fix Version/s: Diana 8243, Selena 7.0.3

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Windows XP, JDK 1.6.0_03, Hibernate 3.2.4 SP1, Hibernate annotations 3.3.0, Spring 2.5

Build: 7,590
Fixed in build: 7,663
Severity: Medium


 Description  « Hide
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



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