Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Hibernate section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 6th, 2009, 01:13 AM
Authorized User
 
Join Date: Dec 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to annumol
Default 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.









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.