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

  • Mastering Hibernate
  • Ramin Rad
  • 225字
  • 2021-07-16 10:54:41

Chapter 2. Advanced Mapping

In this chapter, we will explore mapping concepts. This is at the core of the Object-Relational Mapping challenge to correctly map Java objects and classes to their persistence representation. As discussed in the previous chapter, the object-oriented world has a lot in common with the relational world, attributes, types, and so on. The ORM solutions, such as Hibernate, were created to address their notable differences, inheritance, composition, object reference and identification, and much more. After reading this chapter, you will be able to correctly map database identification to a class attribute using primitive data types or a more complex Java class. You will also see how to create associations between objects and annotate them correctly so that Hibernate has enough information about the relationships between table data. Furthermore, you will be able to instruct Hibernate to perform cascaded operations and map classes as part of an inheritance model. Finally, you will see how to work with enumerated types and create your own custom type.

In this chapter, we will cover the following topics:

  • Mapping concepts:
    • Instance and row
    • Annotation verses XML
    • Owning entity
    • Value mapping
    • JPA ID generation
    • Hibernate ID generation
    • Composite ID
  • Association cardinality:
    • One-to-one association
    • One-to-many association
    • Many-to-many association
    • Self-referencing tables
  • Cascade operations
  • Inheritance:
    • Single table strategy
    • Table per class strategy
    • Joined strategy
  • Custom mapped data type
主站蜘蛛池模板: 米泉市| 康平县| 庐江县| 清丰县| 旌德县| 淮阳县| 额尔古纳市| 大埔县| 昌邑市| SHOW| 衡水市| 周至县| 竹溪县| 南宁市| 紫云| 土默特右旗| 自治县| 汾阳市| 简阳市| 刚察县| 鄂托克前旗| 滨州市| 东至县| 门源| 马边| 枣庄市| 宜兴市| 太仆寺旗| 工布江达县| 自贡市| 获嘉县| 七台河市| 德阳市| 孙吴县| 沙湾县| 兴城市| 岚皋县| 三穗县| 容城县| 东兴市| 泽普县|