Announcement Announcement Module
Collapse
No announcement yet.
EntityManager versus getHibernateTemplate()? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • EntityManager versus getHibernateTemplate()?

    Hi

    Which one we should use, entity manager or hibernate template in spring?
    from the design perspective which one is better.


    Thanks
    ved

  • #2
    You are comparing apples and oranges. You should either compare the SessionFactory and HibernateTemplate or EntityManager and JpaTemplate. I suggest you read this.

    Comment


    • #3
      Thanks Marten for the reply.

      I was my bad that i didnot explain the question properly. I went through the blog and must say it was very informative.

      Basically i wanted to know, from the design and approach perspective, as to whether to use Hibernate session or the JPA entitymanager api's when you are starting a new project.

      My take would be to use Entitymanager for the very simple and basic fact that one should always use and follow the specification api's (JPA) rather then using then using the implementation of the specs i.e Hibernate session.

      Just wanted to know the views of experts out there.

      Thanks
      Ved

      Comment


      • #4
        There is no real design decision here (with JPA or hibernate 3.0.1 or higher) before that your code would be scattered with

        a) Error handling code
        b) transaction management code

        The HibernateTemplate/JpaTemplate made that easier, however as the blog explained there is no need for that anymore...

        Comment

        Working...
        X