There are two tables Period_Type & Product_Subscription
Period_Type
->ID
->Period_Type_Name
---------------------------------------
Product_Subscription
-> RENEWAL_PERIOD_TYPE_ID
-> SUBSCRIPTION_PERIOD_TYPE_ID
----------------------------------------
-> FOREIGN KEY (RENEWAL_PERIOD_TYPE_ID) REFERENCES PERIOD_TYPE(ID)
-> FOREIGN KEY (SUBSCRIPTION_PERIOD_TYPE_ID) REFERENCES PERIOD_TYPE(ID)
How to implement the above schema using JDL?
Please read the doc: https://www.jhipster.tech/jdl/relationships about JDL syntax and also there is an example which is exactly your use case: https://www.jhipster.tech/managing-relationships/#two-one-to-many-relationships-on-the-same-two-entities
You must indicate the relationship name in the relationship definition so that it is used for both the entity's field for the name of the foreign key in Liquibase changelog.
Additionally, you can also specify which field to use for display in frontend.