[英]How to use hibernate4-maven-plugin to generate multiple dialects schemas?
[英]DB2 - Foreign key constraint length generated by juplo/hibernate4-maven-plugin is too long
我收到以下錯誤:
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0107N The name "FK_11CCTW7HP8CNTIYTKPMYGNBF" is too long. The maximum
length is "18". SQLSTATE=42622
當我跑步時:
db2 'alter table adviserMediaContent add constraint FK_11cctw7hp8cntiytkpmygnbf foreign key (mediaContentId) references mediaContent;'
SQL是juplo / hibernate4-maven-plugin生成的架構的一部分。 任何想法如何縮短插件中的約束?
這些名稱是由Hibernate生成的。 您可以使用@ForeginKey
注釋(不是JPA,而是Hibernate注釋)來指定約束名稱。
在Hibernate 5中,您可以使用命名策略來生成約束名稱。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.