This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line! See this thread for details.
I am learning hibernate and looking for a sample project with several class files using hibernate.
Things i need help with learning
-Session management = I have created Employee, EmployeeDAO interface, and EmployeeDAOImpl implementation classes all being controlled by Main.java . The classes will have create, read, update, delete methods and i need a better example of how to handle sessions, transactions, and close out in each method.
-How to move the xml mapping from hibernate.cfg.xml for Employee class to the EmployeDAOImpl methods
Go from this
You're looking for an antique form of Hibernate. Your samples are all original (legacy) Hibernate.
I don't recommend using legacy Hibernate. Use Hibernate JPA. Hibernate JPA, unlike the original Hibernate is supported by the JEE EJB3/JPA standard. In fact, Hibernate was a big part of designing the JPA standard. So you can pretty well assume that Hibernate JPA will be taking part in all of the latest ORM features. You can't assure that legacy Hibernate will. For that matter, it's likely that some day Hibernate will drop legacy support entirely.
As it happens, I do have an open-source web application using Hibernate JPA under the Spring Data framework and it's available for anyone to view and for that matter, to contribute to. If you're interested. I've been using this technology for quite a few years now on various applications.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.