0

我正在做一些 CRUD 操作。所以我找到了如何创建、更新、删除和部分选择语句。为什么我说部分选择意味着我有三个名为Person,ContactInformation和的实体Address。这三个对象之间的关系是Addressin 的外键ContactInformationContactInformationin 的外键Person。所以现在我知道了 Person ID 以及如何获取与此 Person ID 相关的记录(我想要的方法PersonContactInformation记录Address)。目前我正在使用

    Model model = (Model) this.getCurrentSession().get(
                this.getPersistentClass(), argId);

这里持久类是Person.class. 所以有了这个,我可以得到Person记录,但我不能得到ContactInformationAddress记录。见下图。

在此处输入图像描述

4

0 回答 0