ElementCollection createAlias in hibernate API

后端 未结 3 1741
北荒
北荒 2021-02-07 12:53

does anyone know if and how the solution for following question (which is written in the JPA API) can be written using the hibernate criteria API?

To be more specific I

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-07 13:08

    Can you give us a more complete schema and query?

    Also, Criteria API sucks. Try using QueryDSL, your query might look like:

    HibernateQuery q=new HibernateQuery(getSession())
    .from(QDiscussion.discussion).from(QDocument.document)
    .where(QDocument.document.userName.in(QDiscussion.discussion.userNames))
    .list(QDocument.document);
    

提交回复
热议问题