java - Hibernate中property-ref有什么用

标签 java hibernate

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/

相关文章:

spring - JpaRepository 删除子元素

java - 空 while 循环的线程问题

java - 在 Android 应用程序中实现 google plus 登录时出错

java - IOException - read end dead - 在此示例中导致它的原因以及如何修复它 - Java 中的多线程应用程序

java - Spring MVC 项目的 JUnit 测试中的 @Autowired 问题

java - hibernate 标准中 LEFT_JOIN 中的 OR 子句

java - JPA 如何识别两个具有相同名称但位于不同包中的类?

java - Spring Boot Rest Controller 使用 Jackson 和 Hibernate 将 POJO 转换为 JSON 时出错

内存中异常的 Java 大小

java - 使用java中的比较器对二维数组的每一列进行排序