HQL and one-to-many queries

后端 未结 1 1268
生来不讨喜
生来不讨喜 2020-12-15 08:50

I have Hibernate domain objects that looks like this:

   class Player {
      List inventory;
   }

   class Item {
      List         


        
相关标签:
1条回答
  • 2020-12-15 09:30

    Assuming the appropriate mappings on all of the above, the query you're looking for is:

    select p
    from Player as p
      left join p.inventory as i
      left join i.enchantments as e
    where e.isSuperiorEnchantment = 1
    
    0 讨论(0)
提交回复
热议问题