Hibernate and Unexpected end of Subtree exception

后端 未结 4 1474
后悔当初
后悔当初 2021-01-07 17:51

I\'m a newbie to Hibernate.

I have an Item POJO which contains a Set consisting of labels. The labels are contained on anothe

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-07 18:17

    Based on the comments on the bug HHH-5209, which is about the same exception being thrown from a similar JPQL query, i believe the correct form here is:

    select item from Item item where 'hello' in elements(item.labels)
    

    The elements function there is the key. This is perhaps slightly simpler than Yuri's suggestion, because it avoids the explicit join.

提交回复
热议问题