Finally!!! I have a Struts 2 + Hibernate working example!🙂
Questions I have to answer:
1. How is session factory created from the hibernate.cfg.xml?
2. Why should serializable be implemented by the model classes?
3. What are the uses of Annotations? (I’ve read about this before but I still have to know more about it)
Why should I put annotations in the model class? @Entity and @GeneratedValue @Column?
4. Why do I have to create a serialVersionUID?
5. What does session.load() do?
6. How does session.createQuery(String) work?
I came across numerous streams of exciting information about different frameworks/tools/technologies related to J2EE in the past few days. It’s been a really exciting adventure. I learned about Maven, Hibernate tools, and Icesoft. When I was already feeling really anxious to have a working sample of Struts 2 + Hibernate integration, I came across this site: http://viralpatel.net/blogs/2010/01/tutorial-struts2-hibernate-example-eclipse.html
. It was just what I needed – a Struts 2 + Hibernate + MySQL tutorial. I had problems working with Maven because I am not yet very familiar with how I should run the application within Eclipse. So I decided to look for a tutorial that does not involve Maven. However, I will go back to it again in the future because I appreciate its use and how it simplifies the (automatic) downloading (collection) of jar files.
Right now, my priority is to learn Hibernate with MySQL so that I can start on building my mini-project.