This REALLY should be documented by the JetBrains folks but I figured out how to stop that eternal import wait. In IntelliJ, you set up a datasource in the Database view. You have added persistence.xml to a module and now want to use the JPA plugin functionality to generate an entity class, probably on a rather large table you do not want to write the class for by hand. You are in the Persistence view, right-click on your module name, choose Generate Persistence Mapping > By Database Schema, and the nice dialog opens. You choose your data source, a package to add the generated class file(s) to, all is fine. Next you click the Refresh icon and you wait for eternity. It should not be this hard. You probably kill IJ a couple times before giving up and wishing you had become an accountant like your mother told you to do. Fortunately there is a fix for this. Keep reading.
IJ version: 2016.3.1 Ultimate