Does anyone know if there is a plugin available for IntelliJ that will draw the database schema diagram based on JPA entity classes?
3 Answers
IntelliJ (ultimate edition) can generate an ER diagram, without any additional plugins. It's available from the context menu in the "Persistence" pane.
To get that pane, you'll need to add a "JPA" facet to your module first.
-
how do you add the JPA facet to your module? I can't seem to find that. Commented Dec 13, 2011 at 23:12
-
2In Project Structure (Ctrl-Shift-Alt-S), you'll see a list of modules. There's a "+" (plus) button above the module list. Clicking it will allow you to add various facets to existing modules. Examples are: Spring, GWT, Hibernate and JPA. Note that support for "enterprisey" frameworks (like JPA) is not part of the free IntelliJ "Community" edition. Commented Apr 13, 2012 at 8:33
pre-requisite to get "ER Diagram" entry in the context menu :
- ultimate version (seems not be available into the "Community version")
- JPA Facet onto the module
- UML Plugin activated (files/other settings/configure plugins ; this plugin enables diagrams)
- then Right clic onto the "persistenceUnit" into the "Persistence" tool windows
I just add this comment into the official documentation (comment awaiting moderation).
Official doc : http://www.jetbrains.com/idea/webhelp/opening-jpa-or-hibernate-er-diagram.html