私は 8 列の DB にマップされたクラスを持っていますが、hql では、case when ステートメントを使用して、select ステートメントで 9 番目の列を作成しています。予期しないtoeknを与えています。構文エラーのようです。しかし、正確な構文エラーを把握することはできません。
私が得た例外
org.jboss.resteasy.spi.UnhandledException: javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: 予期しないトークン: ( 行 1、列 353 付近
[un.id, un.timestamp, un.recipientUser, un.sendingUser,un.messageType, un.body, un.title, un.readTimestamp, case when sentUser > recipientUser then CONCAT(sendingUser,'-',recipientUser) を選択ELSE CONCAT(recipientUser,'-',sendingUser) END as normalized_message_parties from com.xxxxx.platform.xxx.notification.xxxxxx.UserNotification un inner join (タイムスタンプとして max(timestamp) を選択、singingUser > recipientUser の場合 CONCAT(sendingUser, '-',recipientUser) ELSE CONCAT(recipientUser,'-',sendingUser) END as normalized_message_parties from com.xxxxx.platform.xxx.notification.xxxxxx.UserNotification un where un.sendingUser like :userID または un.recipientUser like :userID group by normalized_message_parties) as m on ( m.normalized_message_parties = normalized_message_parties and m.timestamp = un.タイムスタンプ) タイムスタンプによる順序 DESC]
問題を見つけることができません..あなたが私を助けるために他に何を必要としたかわかりません..だから私にそれを投稿することを知らせてください..しかし私が思う限り..クエリ構文の問題中継。私は休止状態3.4を使用しています