­

关于“Cannot resolve table ‘user’”报错的问题解决

  • 2020 年 10 月 28 日
  • 筆記

  springboot+vue建立映射时,后端引用@Table(name=“user”) 来对应表名 user,但引用后报错“Cannot resolve table ‘user’”,尝试了多篇博主的博文后,问题解决,现在总结一下各位大佬的方法:

 

第一:View–>Tool windows–>Database–>Data Source–>MySQL输入Host、Port和账号密码进行测试

 

 

 

 

 

 如果报Server returns invalid timezone. Need to set ‘serverTimezone’ property.在URL后缀加上?serverTimezone=GMT%2B8

 

 

测试成功后,Apply后点击OK

 

 

第二:View–>Tool windows–>Persistence后双击“entityManagerFactory”右键选择Assign Data Sources加载刚才建的Database

 

 

 

 

 

 上述两步执行后还报“Cannot resolve table ‘user’”的话,尝试以下操作File–>Settings–>Editor–>Code Style–>Inspections取消JPA的勾选框。