Search code examples
jhipsterjdl

How to add constraints to relationships, while using JDL studio?


[JHipster Generator 4.14.4]

i generate an "article" with some relationships with JDL Studio. Relationships in my article.json look like this :

    "relationships": [
    {
        "relationshipType": "one-to-one",
        "relationshipName": "adress",
        "otherEntityName": "adressDomain",
        "otherEntityField": "id",
        "ownerSide": true,
        "otherEntityRelationshipName": "article"
    },

How can i add the required rules to my relationship?

i tried "relationshipValidateRules": "required" but it doesnt works.


Solution

  • My Answer is not to change in the JSON File but to regenerate the *.jh file on JDL-Studio.

    Here is how to add the required:

    relationship OneToOne {
       Article{adress required} to AdressDomain
    }