When I used a SQL query in Hibernate (HQL) I got following error:
student is not mapped. [select stud.vStudentName from student as stud]
Here is table name in MySQL and following is function of the select query.
public static void querySubject(Session session)
{
String sql_query="select stud.vStudentName from student as stud";
Query query1=session.createQuery(sql_query);
for(Iterator it=query1.iterate();it.hasNext();)
{
Object[] row = (Object[]) it.next();
System.out.println("Subject Name:"+row[0]);
}
return;
}