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

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.

主站蜘蛛池模板: 澄迈县| 车险| 汕头市| 万载县| 冷水江市| 门源| 二连浩特市| 凯里市| 衡东县| 新宁县| 永嘉县| 辉南县| 高清| 河西区| 景泰县| 通渭县| 房产| 颍上县| 县级市| 社旗县| 赤水市| 南乐县| 民勤县| 玛沁县| 怀柔区| 北宁市| 井陉县| 科技| 龙南县| 瑞金市| 城步| 北流市| 青河县| 怀化市| 长顺县| 惠来县| 海丰县| 长泰县| 墨竹工卡县| 阜新市| 昌乐县|