无法解析'USERNAME'列 [英] Cannot resolve column 'USERNAME' less
问题描述
我开发了Spring Framework MVC应用程序。我也使用休眠。现在我为User实体制作简单的POJO。
@Entity
@Table(name =USERS)
public class User {
@Column(name =USERNAME,nullable = false,unique = true)
私有字符串用户名;
}
- 我配置org.springframework.orm.hibernate4 .LocalSessionFactoryBean
我的代码正在运行,但IDEA向我显示了下一个警告。
无法解析'USERNAME'列...(Ctrl + F1)此检查
控制是否针对
配置的Datasources检查了持久性ORM注释
我做错了什么?
当光标位于 USERNAME
上时,按 Alt + Enter
查看弹出窗口并显示可用操作。你会看到一个选项配置数据源或类似的东西,选择它,你会看到一个窗口。您应该根据您的数据库类型(PostgreSQL,MySQL等)添加新的数据源,并使用连接参数进行配置。
有用的链接:管理数据源
I develop Spring Framework MVC application. Also I use hibernate. Now I make simple POJO for User entity.
@Entity
@Table(name="USERS")
public class User{
@Column(name = "USERNAME", nullable = false, unique = true)
private String username;
}
- I configure org.springframework.orm.hibernate4.LocalSessionFactoryBean
My code is working, but IDEA show me a next warning.
Cannot resolve column 'USERNAME' less... (Ctrl+F1) This inspection controls whether the Persistence ORM annotations are checked against configured Datasources
What do I do wrong?
Press Alt+Enter
when cursor is on USERNAME
to view popup with available actions. You'll see an option "Configure data sources" or something like that, choose it, and you'll see a window. You should add new data source based on your database type (PostgreSQL, MySQL, etc) and configure it with your connection params.
Helpful link: Managing Data Sources
这篇关于无法解析'USERNAME'列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!