A: basic mapping: A data table corresponding to an entity class, called this mapping as the basic mapping
Two : relational mapping: It is the mapping that deals with the relationship between n related objects and n related tables on the basis of basic mappings. Mainly divided into the following types:
- One-Way Association
- One-to-one bidirectional mapping
- One-to-many unidirectional mappings
- One-to-many bidirectional mapping
- Many-to-one one-way mappings
- Many-to-one bidirectional mapping
- Many-to-many unidirectional mappings
- Many-to-many bidirectional mappings
Note: In the various mappings above, it can be divided into: Primary key association map and foreign Key Association mapping.
Primary Key Association mappings: The primary key of one table is associated with the primary key of another table,
Foreign Key Association mappings: A table's primary key is associated with another non-primary key.
(Foreign key x: That is, X is the primary key of a table, and X is also a non-primary key for another table)
Three: Category explanation:
One-way mapping: From the object's perspective, the (person) object contains references to (Idcard) objects, and (Idcard) objects do not contain references to (person) objects.
Hibernate------Mapping related