HQL One to many join query

Enity Relation


 class Player {
      List<Item> inventory;
   }

   class Item {
      List<Enchantment> enchantments;
   }

   class Enchantment {
      boolean isSuperiorEnchantment;
   }
Select Query
select p
from Player as p
  left join p.inventory as i
  left join i.enchantments as e
where e.isSuperiorEnchantment = 1

0 comments:

Post a Comment