I use PostgreSQL, Intellij IDEA, Spring MVC, Hibernate.
When I'm trying retrieve list of users from table "Users" I recieve exception like below:
SEVERE: Servlet.service() for servlet [idea] in context with path [] threw exception [Request processing failed; nested exception is org.hibernate.QueryException: unexpected char: '"' [select * from "Users"]] with root cause org.hibernate.QueryException: unexpected char: '"' [select * from "Users"].
When I trying execute SQL query (select * from "Users"
) in DB console it working fine.
Here's me code when I recieve exception:
public List listUser() {
return sessionFactory.getCurrentSession()
.createQuery("select * from \"Users\"").list();
}
Can somebody advice me with this issue?