在 Hibernate documentation ,在 5.1.4.2 节下。与 hbm.xml 的属性映射
,提到:
unique (optional): enables the DDL generation of a unique constraint for the columns. Also, allow this to be the target of a property-ref.
Hibernate 中 porperty-ref
属性的用途是什么以及我们何时需要使用它?请解释一下。
最佳答案
当备用键上的关联可以通过 property-ref
属性完成时。
property-ref
(可选):连接到此外键的关联类的属性名称。如果未指定,则使用关联类的主键。
请点击以下链接通过示例详细了解:
关于java - Hibernate中property-ref有什么用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25334109/