Priority
Normal
Type
Bug 
State
Fixed 
Assignee
Peter Gromov 
Subsystem
Editor. Error Highlighting 
Affected versions
Fixed in
Fixed in build
Next build 
Build
7590
Fixed in build
8105
Severity
0
  • Submitted by   Kenneth Christensen
    2 years ago (19 Dec 2007 14:27)
  • Updated by   root
    3 weeks ago (17 Jan 2010 19:56)
  • Jira: IDEA-42316
    (history, comments)

IDEA-42316

QL inspection flags error

0
Added by <no user>
15 Sep 2009
ql-error2.jpg   (61 KB)
Added by <no user>
15 Sep 2009
ql-error1.jpg   (76 KB)
Added by <no user>
15 Sep 2009
ql-error1-ok-using-in.jpg   (71 KB)

Two errors (see attachments):

Error #1.

select f from Food f where f.id = {color:red}(select fn.foodId from FoodName fn where (fn.name = :name or lower(fn.name) like :nameLowercase) group by fn.foodId){color} and (f.user.id is null or f.user.id = :userId or f.id = (select f2.id from Food f2, User u where f2.user.id = u.id and u.class = 'Sponsor'))

The above query is a valid one

Error #2.

select f from Food f where f.id = (select fn.foodId from FoodName fn where (fn.name = :name or lower(fn.name) like :nameLowercase) group by fn.foodId) and (f.user.id is null or f.user.id = :userId or f.id = (select f2.id from Food f2, User u where f2.user.id = u.id and u.{color:red}class{color} = 'Sponsor'))

Looks like IDEA don't like x.class !


Environment: EJB3

Issue was resolved
Comments (2)
 
History (1)
 
Links
 
Peter Gromov
  Peter Gromov
30 Dec 2007 17:13
(2 years ago)
#permalink
How did you manage to create 'class' attribute?
Kenneth Christensen
  Kenneth Christensen
30 Dec 2007 18:54
(2 years ago)
#permalink
Sorry - I'm mixing HQL and EJB-QL in my queries !

I'm using JBoss EJB3/JPA (JBoss 4.2.2.GA) implementation aka Hibernate.

http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/queryhql.html:

Likewise, the special property class accesses the discriminator value of an instance in the case of polymorphic persistence. A Java class name embedded in the where clause will be translated to its discriminator value. Once again, this is specific to HQL. select cat from Cat cat where cat.class = DomesticCat