Reputation: 309
any expert tell me where i find a basic example of Srtuts2+Spring+Hibernate
Upvotes: 0
Views: 162
Reputation: 1358
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.
Upvotes: 2