6 comments
Comment actions Permalink

Hibernate treats this as HQL and not JPAQL.
HQL injection occurs in the following cases:

  • Hibernate facet present

  • Hibernate provider is set as persistence provider in JPA facet persistence.xml.

  • It is directly configured in Settings/Language Injection instead of JPAQL



On 02.07.2010 15:55, Petras - wrote:

I have inspection Java EE Issues>  Persistence QL Problems enabled in  my IntelliJ (v95.214). It works fine except it reports
error on  expresion: Image:QL_inspection_error.png

>

Hibernate accepts this construction without problem.

>

--- Original message URL: http://devnet.jetbrains.net/message/5266918#5266918


0
Comment actions Permalink

Gregory Shrago, thank you for your reply.

In my project:

  • Hibernate facet was present
  • Hibernate provider was set as persistence provider  in JPA facet persistence.xml.
  • According to your suggestion I set these items in Settings/Language Injection to Hibernate QL:
    • java: NamedQuery.query (javax.persistence)
    • java: EntityManager.createQuery (javax.persistence)


But it didnt change anything - inspection still reports the same problem. Nothing changes even if I extract query string and put language injection annotation:
@org.intellij.lang.annotations.Language("HQL")
String query = "select cast(count(c) as integer) from ItuStatus c where c.link.id = :linkId";

0
Comment actions Permalink

I got it.
Even the ticket is here.

http://youtrack.jetbrains.net/issue/IDEA-20921


On 04.07.2010 15:35, Petras - wrote:

Gregory Shrago, thank you for your reply.

>

In my project:

  • Hibernate facet was present

  • Hibernate provider was set as persistence provider  in JPA facet persistence.xml.

  • According to your suggestion I set these items in Settings/Language Injection to Hibernate QL:

  • java: NamedQuery.query (javax.persistence)

  • java: EntityManager.createQuery (javax.persistence)

>
>

But it didnt change anything - inspection still reports the same problem. Nothing changes even if I extract query string and put language injection annotation:
@org.intellij.lang.annotations.Language("HQL")
String query = "select cast(count(c) as integer) from ItuStatus c where c.link.id = :linkId";

>

---
Original message URL: http://devnet.jetbrains.net/message/5266969#5266969


0
Comment actions Permalink

I see. It seems it's an old issue. And today I see it is just has been fixed! Thank you, Gregory, for assistance.

0
Comment actions Permalink

Thank you for your interest.
It's a common practice that a ticket priority is altered by YouTrack votes and forum requests. :)

Gregory Shrago


On 08.07.2010 13:52, Petras - wrote:

I see. It seems it's an old issue. And today I see it is just has been fixed! Thank you, Gregory, for assistance.

>
>

--- Original message URL: http://devnet.jetbrains.net/message/5267258#5267258


0
Comment actions Permalink

Hi, i am fighting with the same problem in my project and based on this discussion could not fix the problem. :(

I migrated my project from IntelliJ 6. I have configured a Hibernate facet. I also have the 2 settings specified for "Settings/Language Injection".
I have created a JPA facet, but i'm not sure how to configure it. Can somebody please point out what i have to do?

0

Please sign in to leave a comment.