问题
I found this solution for a problem I have: how to generate entities with JPA annotations from a given database.
IntelliJ IDEA 10 generate entity (POJO) from DB model
Now with IntelliJ I'm given the possibility to create relationships between entities manually. Is there a way to generate them automatically as it did with entities?
I used the REFERENCES
keyword when needed while creating the database. I suppose there should be an automatic mapping of relationships as well!
回答1:
When Generating entities from DB Schema in dialog there is an option to 'Show default relationships' which when selected will display FK relationships when selecting tables to generate entities from:
来源:https://stackoverflow.com/questions/46219547/how-to-generate-automatically-relationships-with-jpa-with-intellij