0

I´tm trying to follow this tutorial, but theres an error in the @Table annotation:

Cannot resolve table 'EMPLOYEE'

What i need to do so intellij recognizes the h2 database and eliminate this error? enter image description here

Rômulo Sorato
  • 1,570
  • 5
  • 18
  • 29
  • This table must exist in database you have configured for project and must be visible in [Database tool window](https://www.jetbrains.com/help/idea/database-tool-window.html). Also the persistence unit must be associated with this data source. Check [Intellij IDEA: specify datasource for JPA validation](https://stackoverflow.com/questions/14356148/intellij-idea-specify-datasource-for-jpa-validation) and [Associating persistence units and session factories with data sources](https://www.jetbrains.com/help/idea/working-with-the-persistence-tool-window.html#assign_data_source) – Andrey Dec 23 '19 at 10:08

1 Answers1

0

This table must exist in database you have configured for project and must be visible in Database tool window. Also the persistence unit must be associated with this data source. Check Intellij IDEA: specify datasource for JPA validation and Associating persistence units and session factories with data sources

Andrey
  • 15,144
  • 25
  • 91
  • 187
  • As far as i understand, the data source will created as soon the app is running , accordingly to the tutorial.But this is not happening – Rômulo Sorato Dec 23 '19 at 23:50
  • `the data source will created as soon the app is running` you need to set up data source manually, please see [Connect to a database](https://www.jetbrains.com/help/datagrip/connecting-to-a-database.html). – Andrey Dec 26 '19 at 12:47