![](/img/trans.png)
[英]How to change the name and value of default ID field of an entity in jhipster
[英]Jhipster: How to create a relationship using a field not the id
我有2個實體Country abd競爭,我想使用國家的isoCode在它們之間建立關系,但是當我生成數據庫(mySql)時,我發現該關系基於生成的country_id。 我想念的是什么? 我可以指定自己的ID並從jdl文件中刪除生成的ID嗎?
entity Country {
isoCode String required
.
.
}
entity Competition {
priority Integer,
code String,
name String
}
relationship OneToMany {
Country to Competition{country(isoCode)},
}
謝謝
JHipster僅支持關系的技術ID,如果要使用業務ID,則必須手動對其進行編碼,也許可以看看Hibernate @NaturalId
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.