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.
Bjoke: A "Bully Joke". A Statement or action made with malicious intent - unless challenged. At which point it magically transforms into "I was just funnin'" or "What's the matter, can't take a joke?"