I am new to Hibernate, I am trying to update the table column like below, but it's giving an exception - table is not mapped exception.
Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction();
String hqlUpdate = "UPDATE TEST_TABLE SET LAST_REFRESH_DATE = :dateToday";
Query query = session.createQuery(hqlUpdate);
query.setParameter("dateToday", new UtilityDate().getTodayDate());
int result = query.executeUpdate();
System.out.println("Rows affected: " + result);
Exception
SEVERE: Servlet.service() for servlet [springmvc] in context with path [/TEST] threw exception [Request processing failed; nested exception is org.hibernate.hql.ast.QuerySyntaxException: TEST_TABLE is not mapped [UPDATE TEST_TABLE SET LAST_REFRESH_DATE = :dateToday]] with root cause org.hibernate.hql.ast.QuerySyntaxException: TEST_TABLE is not mapped [UPDATE TEST_TABLE SET LAST_REFRESH_DATE = :dateToday] at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:181) at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:110) at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:94)
I've verified all related questions already in Stack Overflow.