我正在做一些 CRUD 操作。所以我找到了如何创建、更新、删除和部分选择语句。为什么我说部分选择意味着我有三个名为Person
,ContactInformation
和的实体Address
。这三个对象之间的关系是Address
in 的外键ContactInformation
和ContactInformation
in 的外键Person
。所以现在我知道了 Person ID 以及如何获取与此 Person ID 相关的记录(我想要的方法Person
和ContactInformation
记录Address
)。目前我正在使用
Model model = (Model) this.getCurrentSession().get(
this.getPersistentClass(), argId);
这里持久类是Person.class
. 所以有了这个,我可以得到Person
记录,但我不能得到ContactInformation
和Address
记录。见下图。