此内容没有您所选择的语言版本。
Chapter 7. Association Mappings
7.1. Introduction 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Association mappings are often the most difficult thing to implement correctly. In this section we examine some canonical cases one by one, starting with unidirectional mappings and then bidirectional cases. We will use
Person
and Address
in all the examples.
Associations will be classified by multiplicity and whether or not they map to an intervening join table.
Nullable foreign keys are not considered to be good practice in traditional data modelling, so our examples do not use nullable foreign keys. This is not a requirement of Hibernate, and the mappings will work if you drop the nullability constraints.