How to generate automatically relationships with JPA with IntelliJ?

让人想犯罪 __ 提交于 2021-01-28 07:57:47

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!