Link ing outline
Link ing
Relationship between objects
1. the ing here refers to the relationship between objects, not the relationship between databases. The problem solved in this chapter is how to map database tables when the current object is in the following relationship, how to handle programming (Red focuses)
2. Simplify the problem:
A) How to Write Annotation
B) add, delete, modify, query, and write CRUD
3. One-to-one
A) unidirectional (primary key and foreign key)
B) bidirectional (primary key and foreign key)
C) Intermediate table (rarely used)
4. one-to-many
A) unidirectional
B) bidirectional
5. Many-to-one
A) unidirectional
B) bidirectional (one-to-multiple bidirectional is one thing)
6. many-to-many
A) unidirectional
B) bidirectional
7. Set ing
A) List
B) Set
C) Map
8. inheritance relationship (not important)
A) Single Table
B) Multiple tables
C) one master table and multiple sub-tables
9. Component ing
A) @ Embeddable
B) @ Embedded
A) unidirectional
B) bidirectional