A
{
Set b = HashSet();
} ,
B
{
Set a = HashSet();
}
两个类是many-to-many关系。
我通过B把符合条件的A集合查讯出来,并且这个A集合我只想要符合条件的一部分。
select c from B b join b.a c where b.id=1 ; //这样只能查出全部的集合。
我还想进一步筛选出c ,该hql如何写?
...全文
1283打赏收藏
hibernate:many-to-many hql 问题。
A { Set b = HashSet(); } , B { Set a = HashSet(); } 两个类是many-to-many关系。 我通过B把符合条件的A集合查讯出来,并且这个A集合我只想要符合条件的一部分。 select c from B b join b.a c where b.id=1 ; //这样只能查出全部的集合。 我还想进一步筛选出c ,该hql如何写?