In the CRM system, a customer has multiple contacts, and a contact corresponds to multiple customers.
Requirements: Save a contact and save a customer
Analysis:
Table relationships
SQL statements
Entity class
More than one contact for a single customer
One customer corresponds to multiple contacts
Why choose the Set method
Set set features: Do not repeat the following 0 for the purpose of not occupying space
Note that when the ToString is not associated with the object to come out, because the Linkman ToString called the customer's ToString so that the cycle of death
mapping files
Multiple contacts for one customer
Because a table's primary key can be used as a foreign key for another table, there is no need to describe which property in the customer corresponds to the foreign key in the Linkman
One customer corresponds to multiple contacts
Hibernate one-to-many mapping relationship