Hibernate------Mapping related

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.