HQL: illegal attempt to dereference collection

后端 未结 2 1945
广开言路
广开言路 2020-12-19 07:18

The situation is like this:

I have an entity Book that holds a one-to-many relationship with Chapter.

Now if I try the query, \"from Book book inner jo

2条回答
  •  伪装坚强ぢ
    2020-12-19 07:51

    You can likely do this with a subquery.

    Something like

    from Book book where not exists (from chapter where 
                       chapter.title like '%hibernate%' and chapter.book = book)
    

    (Not tested ...)

提交回复
热议问题