Note:
The following information is about version 15 and earlier:
First, you need to tell IntelliJ that you are using Hibernate (I guess you are if you need the orm POJO of the table)
Go to "Project structure"
(alt+ctrl+shift+s)
In "Project settings" select "Modules"
Press + and add the Hibernate facet in your module.
Now that you have set up your hibernate configuration facet, you can extract your POJOs.
At your bottom right horizontal panel, you will now see a tab called
"Persistence" (ιf you can't find Persistence tab you may show it by choosing View > Tool Windows > Persistence)
There you can right-click on the hibernate icon named like your module
Go to "Generate Persistence Mapping"-"by database schema"
Now I guess you can find your way...
In general, settings select the datasource that you want to use and now you
can see all the tables in your datasource object
Now you can do many things, add relationships with the + sign, change the
name and type of the POJO's properties etc.
note: if you get an error and the "OK" is disabled its probably because the data
type that IntelliJ found for your POJO is invalid. Just change it to the one
you need and you are ready to go!