我最近了解到可以在JPQL语句中创建新对象,如下所示:
JPQL
select new Family(mother, mate, offspr) from DomesticCat as mother join mother.mate as mate left join mother.kittens as offspr
这是要避免还是要拥抱?根据良好做法,何时使用此功能是合理的?
java orm hibernate jpa jpql
hibernate ×1
java ×1
jpa ×1
jpql ×1
orm ×1