如何使用 JPA/Hibernate 选择 DDL 主键约束名称 [英] How to choose DDL Primary Key constraint names with JPA/Hibernate

查看:22
本文介绍了如何使用 JPA/Hibernate 选择 DDL 主键约束名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

存在一个专有的休眠注释来指定在 DDL 生成时使用的外键约束名称:org.hibernate.annotations.ForeignKey.

There exists a proprietary hibernate annotation to specify the Foreign Key constraint names that are used at DDL generation time: org.hibernate.annotations.ForeignKey.

是否还有一种方法可以指定主键约束名称?

Is there also a way to specify the Primary Key constraint names?

推荐答案

标准 JPA 不可能,Hibernate 也不支持主键约束.

Not possible with standard JPA and not supported by Hibernate for Primary Key constraints neither.

这个功能请求实际上有一个很老的问题(HB-1245)不过好像没怎么关注.

There is actually a very old issue about this feature request (HB-1245) but it looks like it doesn't get much attention.

这篇关于如何使用 JPA/Hibernate 选择 DDL 主键约束名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆