Hibernate NamedQuery

<query name="findGroupsByUser">
    <![CDATA[
    select distinct g
    from org.jbpm.pvm.internal.identity.impl.MembershipImpl m
      join m.user u
      join m.group g
    where u.id = :userId
    ]]>
  </query>

调用
Query query = session.getNamedQuery("findGroupsByUser");
query.setInteger("userId", 25);
List result= query.list(); 


你可能感兴趣的:(JOIN,xml,Hibernate,list,query)