Translated message

A translation of this page exists in English.

クエリヒントを Hibernate で実行できない理由

Solution Unverified - Updated -

Issue

Hibernate 設定にクエリーヒントが含まれる場合は、クエリーを実行するとエラーメッセージがログに記録されます。

server.log.18:org.hibernate.hql.ast.QuerySyntaxException: unexpected token:* near line 1, column 11 [select m /*+index (PK_COLUMN) */ from QueryHint q where q.id.date1 >= :initialDate and q.id.date2 <= :endDate and q.id.text  >= '' and q.number = :no]

これは、使用されるクエリー設定となります。

<named-query name="queryWithQueryHints">
  <query>
    <![CDATA[
       select m /*+index (PK_COLUMN) */
       from QueryHint q
       where
          q.id.date1 >= :initialDate   and
          q.id.date2 <= :endDate       and
          q.id.text  >= ''             and
          q.number = :no
    ]]>
  </query>
</named-query>

Environment

  • JBoss Enterprise Application Platform (すべてのバージョン)
  • Hibernate (すべてのバージョン)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content