Hi,
I'm pretty new at working with Hibernate so please bear with me. Could someone point me to some useful links or please explain though the difference between these two implementation approaches?
While working with Struts 1.X and using Hibernate I started to become familiar with the whole idea of hibernate mapping files and creating appropriate DAO classes for all my services. I find it really good since I can completely decouple the dB layer from the business logic layer and just hibernate mapping files for configuration.
Fast forward - now I have been working with the beta builds of Struts 2.0 following examples of the make use of Hibernate and the new JPA. This introduces Hibernate Annotations and the Hibernate EntityManager. The introduction of the EntityManager and Annotations eliminates the requirement of using hibernate mapping files ( at least from examples i've looked at.)
So my question is really what is the difference between the two approaches? pros and cons? or could someone explain or point me toward material that could clear up my confusion?
In the second approach now I simply can pass my service implementations objects as constructors to my action classes and the entitymanager can take care of the rest (kind of.)
Thanks in advance to anyone who can offer some insight!
Regards,
Paul
|