2015-08-13 28 views
2

你好我正在用jhipster生成器生成一些實體。如何建立實體關係

當我生成一個實體關係時,我想讓該字段中的值爲必需的,但不幸的是,生成器不提供該選項。

反正有沒有通知發電機這種必要性? (編輯.jhipster/entity_name.json),例如?

回答

1

不,這將是一個新功能。 隨意在我們的GitHub項目要創建一個問題,拉請求總是歡迎:)

只是爲了別人,這裏是the issue you opened

+0

我會去問問題XD – snovelli

6

由於this commit JHipster支持的關係需要驗證過。

這是從一個JDL文件的一個示例:

關係多對一{證書{CA(名稱)需要}到CertificateAuthority}

( '證書' 和 'CertificateAuthority' 是實體和'ca'是字段名稱)

來自.jhipster/Certificate.json的相關部分:

"relationships": [ { "relationshipType": "many-to-one", "relationshipValidateRules": "required", "relationshipName": "ca", "otherEntityName": "certificateAuthority", "otherEntityField": "name" },

生成Certificate.ca字段:

@ManyToOne @NotNull 私人CertificateAuthority CA;

而生成的表單有一個'此字段是必需的'。在Ca提交的警告。