"Lập bản đồ Many-to-One hoặc One-to-Nhiều Hiệp hội" của chương này. Chú thích thích hợp là tự nhiên @ ManyToMany, và mất ứng dụng của chúng tôi thường sẽ cần phải xử lý chỉ là một tập hợp con của các dữ liệu trong các bảng cơ sở dữ liệu | 154 CHAPTER 7 CREATING MAPPINGS WITH HIBERNATE XML FILES Table 7-9. Continued Attribute Values Default Description insert true false true Indicates whether the field can be persisted. When set to false this prevents inserts if the field has already been mapped as part of a composite identifier or some other attribute. lazy false proxy noproxy Overrides the entity-loading mode. name The mandatory name of the attribute. This should start with a lowercase letter. node Specifies the name of the XML element or attribute that should be used by the XML relational persistence features. not-found exception ignore exception The behavior to exhibit if the related entity does not exist either throw an exception or ignore the problem . not-null true false false Specifies whether a not-null constraint should be applied to this column. optimistic-lock true false true Specifies whether optimistic locking should be used. outer-join true false auto Specifies whether an outer join should be used. property-ref Specifies the column in the target entity s table that the foreign key references. If the referenced table s foreign key does not reference the primary key of the many end of the relationship then property-ref can be used to specify the column that it references. This should only be the case for legacy designs when creating a new schema your foreign keys should always reference the primary key of the related table. unique true false false Specifies whether a unique constraint should be applied to the column. unique-key Groups the columns together by this attribute value. Represents columns across which a unique key constraint should be generated not yet supported in the schema generation . update true false true When set to false prevents updates if the field has already been mapped elsewhere. If a unique constraint is specified on a many-to-one relationship it is effectively converted into a one-to-one relationship. This approach is preferred over creating a one-to-one .