问题
I'm writing a java code using ormlite. I was wondering if it's possible to generate an ERD from the JPA annotations in my code. Basically, I need the reverse of this: How can I transform Entity-Based diagram to a JPA java code
回答1:
IntelliJ IDEA (Ultimate) provides JPA to ER-Diagram generator.
![](https://i0.wp.com/i.stack.imgur.com/giTbt.png)
In the Persistence tool window, select appropriate node. Then use context menu to select "ER Diagram".
![](https://i0.wp.com/i.stack.imgur.com/Gc2AP.png)
Note that JPA facet must be linked to module and UML plugin should be active.
来源:https://stackoverflow.com/questions/10187048/tool-to-generate-a-erd-entity-relation-diagram-based-on-jpa-annotations