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

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

问题描述

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



是否还有一种方法来指定主键约束<

对于主键约束既不。



这个功能请求其实有一个很老的问题( HB-1245 ),但它似乎没有得到太多的关注。


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?

解决方案

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

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天全站免登陆