jhipster: How to create a one-to-many relationship with user entity?

Viewed 12632

I have created my domain using jhipster-uml JDL script. Now I want to establish a O2M from User to an an existing entity (company). Is there a way to do that via a JDL script? The script would need to re-declare every entity the relationship needs. But these are existing entities, is there a switch to direct jhipster-uml to use the existing domain definition without the need to re-declare it again?

I just want to avoid using the Liquibase/Java manual setup.

3 Answers

I already had such problem, resolved it by creating an additional entity with one-to-one relationship to user, like that:

entity Company
entity UserProfile
relationship OneToOne {
  UserProfile{user} to User
}
relationship ManyToOne {
  UserProfile{company} to Company
}

hope, this will help you

Related