-1

I am about to choose ORM layer for my new Java EE application. From my previous experience I have started to get a feeling that using pure Hibernate instead of JPA will help me speed development speed.

Reasons: 1) There are very rare chances when I will come across the need to replace Hibernate with Eclipse-Link or other ORM provider. 2) HQL processing engine is more old and matured than JPQL engine by any ORM-provider. 3) Hibernate can provide me List of MAP as output result set over List of Arrays provided by JPQL(will have to keep in mind indexes while changing code) . 4) In JPQL to get more customized result set only way is by Binding Entity with Query.

I will be really helpful if someone could help me on this line of thinking.

I want to create a comparison where i can show pros and cons of pure hibernate compared to JPA(by Hibernate)

Charudatta Joshi
  • 119
  • 1
  • 1
  • 5

1 Answers1

1

There is an extensive discussion about JPA vs Hibernate. You can find it here: What's the difference between JPA and Hibernate?

Hibernate already started to deprecate some of it's features like the Criteria. See the docs Chapter 16:

Hibernate offers an older, legacy org.hibernate.Criteria API which should be considered deprecated.

No feature development will target those APIs. Eventually, Hibernate-specific Criteria features will be ported as extensions to the JPA javax.persistence.criteria.CriteriaQuery. For details on the org.hibernate.Criteria API, see Legacy Hibernate Criteria Queries.

https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html

To conclude you should use the JPA API where ever possible and use Hibernate specific features where useful.

Also from the docs Chapter 15:

A JPQL query is always a valid HQL query,

Simon Martinelli
  • 34,053
  • 5
  • 48
  • 82