I have the following JPA entities
Module class with the following attributes
- Identifier
- String name
- String code
- Person manager
Person class with the following attributes
- Identifier
- String name
- String title
- Person supervisor
- Module module
Now I need to create the following relationships for Person
- A many-to-one relationship to its supervising person
- A many-to-one relationship to its module
I have no idea how to create the relationships in its own class (Person -> Person).
Any suggestions would be welcome. Thx
You do it exactly as if you had two entities of different classes:
If you want it bidirectional, then you also do it exactly as if you had two entities of different classes: