What are the commonly used mapping relationships in Hib…
There are several commonly used mapping relationships in Hibernate.
- One-to-one relationship: the association of one attribute of one entity class with one attribute of another entity class.
- One-to-many relationship: one attribute of a class is related to multiple attributes of another class.
- One-to-many relationship: Multiple attributes of one entity class are associated with one attribute of another entity class.
- Many-to-many relationship: multiple attributes of one entity class are associated with multiple attributes of another entity class.
- Inheritance relationships: the inheritance relationships between entity classes, including single table inheritance, concrete class inheritance, and subclass inheritance.
- Component relationship: One or more properties of one entity class make up a property of another entity class.
- Collection relationship: One entity class has a property that is a collection of another entity class.
The above are commonly used mapping relationships in Hibernate, which require different annotations or configurations to be implemented.