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

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.

主站蜘蛛池模板: 霸州市| 乌拉特前旗| 天峨县| 乐平市| 陵川县| 镇康县| 桂阳县| 禄劝| 许昌县| 商南县| 盈江县| 利辛县| 金阳县| 松原市| 雷山县| 西宁市| 额敏县| 大宁县| 镇平县| 宜昌市| 固始县| 屏东县| 乳源| 中阳县| 卓资县| 衡水市| 奇台县| 桐乡市| 肃南| 大关县| 临邑县| 如皋市| 万州区| 大冶市| 焦作市| 五大连池市| 锡林浩特市| 沙坪坝区| 定州市| 堆龙德庆县| 茌平县|