Persistence QL inspection error on constants in HQL

How am I supposed to use "public static final String" in HQL accordning to the "Persistence QL Problems" inspection?

I injected the language "HQL" into the following string using Idea 9.0.2.
The query works in Hibernate but the inspecion marks "se" in red  with the error "Can't resolve expression" and the space after ".SEALED" there is a marker saying "Unexpected token":

    @Finder(query = "from Order o where " +
            "o.status = se.xxx.yyy.domain.objects.Order.SEALED "
            "and o.paymentType = :paymentType")



The se.xxx.yyy.domain.objects.Order class has:
  public static final String SEALED = "sealed";


Thanks a lot for any help!

1 comment
Comment actions Permalink

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

On 06.07.2010 12:48, Gosta Jonasson wrote:

I injected the language "HQL" into the following string using Idea 9.0.2.
The query works in Hibernate but the inspecion marks "se" in red  with the error "Can't resolve expression" and the space after ".SEALED" there is a marker saying "Unexpected token":

>

     @Finder(query = "from Order o where " +
             "o.status = se.xxx.yyy.domain.objects.Order.SEALED "
             "o.paymentType = :paymentType ")

>
>
>

The se.xxx.yyy.domain.objects.Order class has:
   public static final String SEALED = "sealed";


0

Please sign in to leave a comment.