1

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!

Nikolas
  • 2,066
  • 1
  • 19
  • 20
Robb1
  • 4,587
  • 6
  • 31
  • 60
  • Possible duplicate of [IntelliJ IDEA 10 generate entity (POJO) from DB model](https://stackoverflow.com/questions/5259276/intellij-idea-10-generate-entity-pojo-from-db-model) – zpontikas Dec 07 '17 at 19:12

1 Answers1

3

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: enter image description here

Andrey
  • 15,144
  • 25
  • 91
  • 187