Search code examples
mysqlspringjpaintellij-idea

How to fix error "Cannot resolve column..."


I am developing Java web application what based on Spring Framework, MySQL, JPA. I have a problem when try to persistence data from HTML form to SQL database, then I try to debug and fix. I am using IntelliJ IDEA Ultimate 2017.1. I catch error:

Cannot resolve column 'product_name' This inspection controls whether the Persistence ORM annotations are checked against configured Datasources

This is screenshot: enter image description here

How to fix it?


Solution

  • Open Persistence tool windows, right click on module, then set DataSource. IntelliJ IDEA will validate source code by real SQL database. enter image description here