- 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
- The Complete Rust Programming Reference Guide
- Fundamentals of Linux
- MySQL數(shù)據(jù)庫應(yīng)用與管理 第2版
- iOS開發(fā)實戰(zhàn):從零基礎(chǔ)到App Store上架
- Java虛擬機字節(jié)碼:從入門到實戰(zhàn)
- 零基礎(chǔ)學(xué)MQL:基于EA的自動化交易編程
- Xamarin.Forms Projects
- Learning Data Mining with R
- Learning Python Design Patterns
- 搞定J2EE:Struts+Spring+Hibernate整合詳解與典型案例
- 微信小程序開發(fā)實戰(zhàn):設(shè)計·運營·變現(xiàn)(圖解案例版)
- 計算語言學(xué)導(dǎo)論
- Oracle Database XE 11gR2 Jump Start Guide
- JSP應(yīng)用與開發(fā)技術(shù)(第3版)
- 零基礎(chǔ)C語言學(xué)習(xí)筆記