代码之家  ›  专栏  ›  技术社区  ›  Michael Bavin

Hibernate条件:继承:仅获取根类实体的列表

  •  2
  • Michael Bavin  · 技术社区  · 16 年前

    假设我有:

    @Inheritance(strategy = InheritanceType.JOINED)
    public class Child extends Parent{
    }
    

    谢谢你

    1 回复  |  直到 16 年前
        1
  •  2
  •   Andrzej Doyle    16 年前

    看看你的屁股 section 14.9 of the Hibernate documentation :

    特殊属性 class

    from Cat cat where cat.class = DomesticCat
    

    ... where class=Parent 筛选出 Child .