Reputation: 1364
I'm learning hibernate and I am running into some issues. I'm reading "Harnessing Hibernate" by O'Reilly. They explain everything using ANT, but since I want to avoid writing a huge build.xml file, I'm trying to get it to work with IntelliJ.
I managed to make a mapping according to a DB table in a MySQL database, and wrote the bean for it. It worked, but I can't find any information on how to generate beans and SQL code, or how to reverse engineer with IntelliJ. I found loads of tutorials about Eclipse, using JBOSS Hibernate tools plugin, and the site claims this support for generating code is already in the standard installation of IntelliJ.
Am I forgetting some configuration such as adding libraries? I'm trying to find this out but I'm desperate now. Please don't suggest me to use Eclipse, I need IntelliJ for my current role.
Upvotes: 8
Views: 17113
Reputation: 570295
AFAIK, IntelliJ IDEA includes the complete JPA/Hibernate support in its Ultimate Edition:
Generating Persistence Mappings from Database Schema
IntelliJ IDEA allows you to quickly generate persistence mappings from any database schema: Generating Persistance Mappings
(source: jetbrains.com)
Now, the question is, what edition of Intellij IDEA are you using?
Upvotes: 7
Reputation: 308733
If you add the hbm2ddl
to your Hibernate config and ask it to create the database schema you'll get it by running a single test or some other code that exercises Hibernate. Once you have it, turn off create.
Let Hibernate do the work.
Upvotes: 0