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

Key: IDEA-19269
Type: Bug Bug
Status: Open Open
Assignee: Gregory Shrago
Reporter: Andy Kriger
Votes: 0
Watchers: 0
Operations

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

NamedQuery wrongly highlighted as error

Created: 21 Aug 08 21:47   Updated: 22 Aug 08 14:51
Component/s: Editor. Error Highlighting

Build: 8,664
Severity: High


 Description  « Hide
@Entity
@NamedQueries({@NamedQuery(name="UrlMap.all",query="from UrlMap")})
public class UrlMap implements Serializable { // class stuff here }

The query is highlighted as an error ("SELECT expected...")
'from UrlMap' is valid HQL and should be accepted by IDEA



 All   Comments   Work Log   Change History      Sort Order:
Andy Kriger - 21 Aug 08 22:23
Flagged high, because afaik, there's no way to turn off this error highlighting
And it is definitely a v8 issue (works in v7)

Gregory Shrago - 22 Aug 08 14:51
NamedQuery by default accepts only JPA-QL.
"from UrlMap" is not a valid JPA-QL.

There are number of ways to enable HQL mode:

1. Specify hibernate persistence provider in persistence.xml if you use JPA facet
2. Create Hibernate facet & hibernate session factory that includes UrlMap
3. Configure IntelliLang (Settings->IntelliLang) to use HQL in NamedQuery annotation always.

I think it works for you in v7 because of [2].
[1] and [3] are not available in v7.