- 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
- 機(jī)器學(xué)習(xí)系統(tǒng):設(shè)計和實現(xiàn)
- LabVIEW程序設(shè)計基礎(chǔ)與應(yīng)用
- Vue.js 2 and Bootstrap 4 Web Development
- C++ Builder 6.0下OpenGL編程技術(shù)
- Java技術(shù)手冊(原書第7版)
- 實用防銹油配方與制備200例
- 21天學(xué)通C++(第6版)
- C語言程序設(shè)計
- Getting Started with Python Data Analysis
- C# 8.0核心技術(shù)指南(原書第8版)
- Visual Basic程序設(shè)計教程
- Bootstrap 4 Cookbook
- Python爬蟲、數(shù)據(jù)分析與可視化:工具詳解與案例實戰(zhàn)
- Flowable流程引擎實戰(zhàn)
- 多媒體技術(shù)及應(yīng)用