Hibernate and Unexpected end of Subtree exception

后端 未结 4 1467
后悔当初
后悔当初 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:35

    For primitives collections you should use HQL query like this:

    from Item item join item.labels lbls where 'hello' in (lbls)
    

    PS: 'join' is required because 'labels' is OneToMany or ManyToMany variant, parentheses are required because 'lbls' is a collection

提交回复
热议问题