Daemon712 Daemon712 - 2 months ago 12
Java Question

Cannot resolve column 'USERNAME' less

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?

Answer

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