Search code examples
hibernatejhipsterjdl

Relationship in Jhipster with cascade removing (JDL)


I want to create relationship between two entities - for example Directory and File. Its really similiar to example from JDL JHipster. Directory have 0, one or more files. And one file has only one directory. But in this case, I want to store in File entity external ID to Directory entity. In addition, when I delete Directory, I want to delete all files related to this directory. Do you have any ideas how to achieve this in JDL? I have tried to make ManyToOne relationship, but I had problems with cascade removing.


Solution

  • JHipster does not generate any cascading rules for entities because they depend on your business requirements which are unknown to the generator. So JDL cannot help here, you have to code it manually.