Please Help Me!
my java program is a simple search program using hibernate.
SessionFactory factory = HibernateUtil.getSessionFactory();
Session session = factory.openSession();
try
{
Query query = session.createQuery("from book1 l);
List books = query.list();
request.setAttribute("books", books);
} finally {
session.close();
}
RequestDispatcher dispatcher = request.getRequestDispatcher("/Search/S_QuickSearch.jsp");
dispatcher.forward(request, response);
}
}
Here i am in no need of using mapping of any fields. Is it neccessary a hibernate (filename.hbm.xml)mapping file. I just search the query and it forward to JSP.
please help me. can I do a hibernate program without a mapping file.
|