any expert tell me where i find a basic example of Srtuts2+Spring+Hibernate
+2
A:
I can help you with Hibernate.
Hibernate
design a database, or take something off the shelf.
download eclipse+ hibernate tools
read instructions on how to setup hibernate, you can autogenerate your mapping + config files directly from the database.
try some queries out in the HQL and Criteria editor (Eclipse)
fire up Hyperion in your test app with code like this:
public class SessionManager implements HibernateSessionManager { static final SessionFactory sessionFactory; static { try { sessionFactory = new Configuration().configure("hibernate.cfg.xml").buildSessionFactory(); } catch (Throwable e) { System.err.println("Error in creating SessionFactory object." + e.getMessage()); throw new ExceptionInInitializerError(e); } }
SessionManager.sessionFactory.OpenSession() will open a connection that you can run a query with.
once you get hibernate down then layer spring on top, then struts on top of that. trying to do it all at once is a lesson in frustration.
ebt
2010-08-23 05:52:24