官术网_书友最值得收藏!

Summary

Entities do not exist in isolation but are usually associated with other entities. This chapter examined how we map these associations onto a relational database. We first looked at an example with unidirectional one-to-one, one-to-many, and many-to-many associations. We described the @OneToOne, @OneToMany and @ManyToMany annotations for mapping associations to a relational database. Initially we relied on default object/relational mapping values.

We then described a bidirectional example and showed how we could override default object/relational mapping values.

We described eager and lazy loading mechanisms. We gave examples of the @Embedded, @Embeddable, @Enumerated and @MapKey annotations. We saw how to handle composite primary keys.

Finally we looked at a number of object/relational inheritance mapping strategies.

主站蜘蛛池模板: 茶陵县| 定南县| 治多县| 温州市| 哈尔滨市| 信阳市| 永济市| 琼结县| 淮滨县| 开原市| 乌拉特后旗| 临沭县| 改则县| 高密市| 海伦市| 汤阴县| 图木舒克市| 泉州市| 上高县| 郑州市| 宁安市| 额敏县| 卓尼县| 溧阳市| 阿拉善左旗| 凌海市| 彭州市| 丹巴县| 秭归县| 额尔古纳市| 达尔| 吉安市| 民权县| 汉阴县| 镇沅| 涿州市| 中超| 海南省| 云安县| 叙永县| 宜阳县|