Hi
I am very new to Hibernate
In my application, i can enter records into database but i am unable to list them in a jsp. here is the code..
code in my jsp:
Code:
<%
Session hibsession = null;
try{
System.out.println("Listing Records..");
// This step will read hibernate.cfg.xml and prepare hibernate for use
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
hibsession =sessionFactory.openSession();
org.hibernate.Transaction tx = hibsession.beginTransaction();
List empList = hibsession.createQuery("from empdata order by empid").list();
Iterator empIter = empList.iterator();
while(empIter.hasNext()){
Empdata empdata = (Empdata)empIter.next();
%>
This is the error in console:Code:
empdata is not mapped. [from empdata order by empid]
plz let me know where i am making the mistake...
Rgds,
Jim.