How can I generate entity (POJO) from database model using IntelliJ IDEA 10. I create "Data source" in IntelliJ but I have not any idea how can I generate the POJO.
相关问题
- NOT DISTINCT query in mySQL
- Flush single app django 1.9
- Configure gradle plugin based on future tasks
- keeping one connection to DB or opening closing pe
- How to make available “open this project in Intell
相关文章
- In IntelliJ IDEA, how can I create a key binding t
- IntelliJ IDEA can't open projects or add SDK o
- Connection pooling vs persist connection mysqli
- IntelliJ Subversion Authentication Required Dialog
- Kotlin Koans with EduTools plugin: “Failed to laun
- How to set up Intellij to run javap command on a p
- How to enable “type information” for streams retur
- How to add a project to build path in IntelliJ Ide
UPDATE:
In IntelliJ 16 this feature in now implemented. The steps to do it are:
1. Database view context menu
2. Scripted Extensions
3. Generate POJOs
You can read more here:
Feature request: allow "generate classes from database schema" for plain-JDBC developers
First you need tell intelliJ that you are using Hibernate (I guess you are if you need the orm pojo of the table)
Now you have setup your hibernate configuration facet you can extract your pojos.
The default Scripted Extensions
Generate POJOs.groovy
is not very good when dealing with tables with underscore(which is very common).So I make some modifications.
The main code
You can find the whole gist here https://gist.github.com/aristotll/ad799a7462e8b705b26103944cca24a6