简体   繁体   中英

Auto create POJO class from database in IntelliJ

Is there any function in IntelliJ that allows me to generate simple POJO class from database tables (currently using PSQL)? I saw some similar example in Eclipse using "hbm2java".

Yes, it's possible to generate simple POJOs from Database Tables in IntelliJ.

Just follow this instruction:

  1. Connect your database to IntelliJ.
  2. Right click the tables you want to generate your POJOs for
  3. Right Click on your selection --> Scripted Extensions --> Generate POJOs.groovy
  4. Select where to save your POJO classes
  5. Press OK and your POJO files will be created.

Hope this helps. - Tested on IntelliJ 2019.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM