【问题标题】:Hibernate query for left outer join with null id condition具有空 id 条件的左外连接的休眠查询
【发布时间】:2015-02-06 12:38:00
【问题描述】:

是否有任何类似于以下查询的休眠查询?

MySql 查询 >> select * from mother mot left join children ch on ch.mid = mot.id where ch.id is null

mot.id - 母亲的主键

ch.mid - 外键

ch.id - 孩子的主键

【问题讨论】:

    标签: hibernate jpa hql jpql hibernate-criteria


    【解决方案1】:
    select m from mother m left join m.childrens ch 
     where ch.mid = m.id and ch.id is null
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-02
      • 2014-09-24
      • 1970-01-01
      • 1970-01-01
      • 2015-04-17
      • 2011-03-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多