@Id Identifying primary Key properties
1.hibernate5.2 mysql5.7 need not implement Serializable also can?
2. The length of the primary key 255 I generated?
@GeneratedValue primary Key generation policy
1. The primary key is set to a string type, and @generatedvalue (Strategy=generationtype.auto) is set so that it can generate tables, but it generates two tables, one of which is a series table, but cannot be manually assigned. There is a string as the primary key does not use @column (length=8) to set the length, the actual measurement does not limit the length, but the database overhead is a bit larger, but also can be implemented to build the table?
2.auto is the primary key is automatically controlled by the program, identity is the primary key self-growth?
[Email protected], I set to auto, he newly built a list structure of table ...?
@Embeddable Embedded class attributes, added to the header of the embedded class
1. When talking about attribute-level @embeddable annotations, it is not possible to annotate @embedded annotations in reference properties, so why use @embedded annotations?
@EmbeddedId Embedded primary key class implement composite primary key (federated primary key?)
[email protected] labeled on the attribute header, @Embeddable labeled to the composite primary key class header
2. The embedded primary key class must implement the serialization interface and must contain the default public parameterless construction method, which must override the Equals and Hashcode methods
@Transient represents a mapping to a field that is not a database table, the ORM framework ignores the attribute (the ORM framework defaults to a property of @basic)
===================== Association Map ========================
Inter-entity mapping relationships
One-off: a citizen a Social security number
One-to-many (many-to-one): Multiple bank accounts for a citizen
Many-to-many: A student has multiple teachers, a teacher has multiple students
Refer to another article: Hibernate Association map annotations
Hibernate Note Note