Reputation: 11
I am trying to create new entities with JHipster in Java(Spring Framework) When I try to relate my entity with existing User entity (which comes from JHipster by default) I got some errors.
Here is my entities:
I got this errors:
Upvotes: 0
Views: 468
Reputation: 16284
You can't create a bi-directional many-to-many relationship between Course and User, it's not supported please read the documentation. You should also reconsider your object model, it seems to me that there should be Student and Instructor entities which should have a one-to-one relationship with User.
After you gave access to your git repo, I discovered that you are using microservices architecture, it would have helped to say it immediately. What you are trying to do cannot work because User is an entity that exists only in Gateway while your other entities exist only in service app.
Bottom line is: either you don't create relationships with User and only add a userId string field to your entities, or you switch to a monolith application which is much simpler to understand.
Upvotes: 3