Take the 2-minute tour ×

I am new to jpa.

as per my understanding , jpa is specification and hibernate implements jpa and provide add on features along with jpa methods.

But i was going through jpa tutorials , where using entityManager object we can perform CRUD on data, without using hibernate libraries !

So can anyone please let me know

  1. can i use jpa alone using entityManager methods , not using hibernate ?

Please mention some useful link or example.

Much appreciate response.

share|improve this question
Can you 'accept' answers on some of your previous questions? –  Don Branson Mar 18 '13 at 21:59

4 Answers 4

up vote 7 down vote accepted

You are right JPA is specification. Hibernate,EclipseLink are couple of its implementations.

You have to specify the persistence provider(Hibernate,EclipseLink) in order to use the JPA implementation. The persistence providers have the implementaion classes for JPA specifications.

share|improve this answer
Thanks for reply... actually i want to know what exactly is entityManager used for in jpa ? i am referring to this link <link> docs.oracle.com/javaee/5/tutorial/doc/bnbqw.html#bnbqx </link> where without using any hibernate it is performing db operations ... –  Ali Mar 18 '13 at 22:38
Thanks for reply... –  Ali Mar 18 '13 at 22:38
if you are familiar with hibernate. Entitymanager is just like hibernate session. As per the EntityManager definition "The EntityManager API is used to create and remove persistent entity instances, to find entities by their primary key, and to query over entities." just like hibernate session or jdbc connection. –  bornleo Mar 18 '13 at 22:59
ok ... got it ... EntityManager belongs to Hibernate-jpa-api jar... and hibernate session belongs to Hibernate specific jar. so if we want to use jpa then we should only use methods which are defined in hibernate-jpa-api instead of hibernate specific to get benefit of jpa ... am I correct ? –  Ali Mar 18 '13 at 23:05
yes you have got it right, –  bornleo Mar 18 '13 at 23:09

You can't just use JPA, cause it is an API =), but there are plenty JPA implementations:

  1. EclipseLink
  2. ObjectDB
share|improve this answer

If you don't want to use Hibernate (or any other JPA provider), then you must implement your own provider, by giving an implementation for the javax.persistence.spi.PersistenceProvider interface. The question, is, why do you need re-invent the wheel ? If you don't like Hibernate, you can use one of the so many other JPA-Providers to choose from

share|improve this answer

You can use JPA alone without using Hibernate and Before should know about major points in between Hibernate vs JPA as given below.


  1. Hibernate is a ORM Framework which is support complete ORM and also use JPA features.
  2. Second level Cache is available so Performance is very good
  3. Its support .Net using NHibernate tool
  4. Its generate HQL(Hibernate Query Language)


  1. JPA is part of EJB specification which is released in J2EE 1.5 and this will use for java as well as J2EE
  2. Second Level Cache is not available so Performance is not good.
  3. Its not support to .Net
  4. Its generate JPQL(Java Persistence Query Language)
  5. Top of any persistence provider like Hibernate we can use JPA.
share|improve this answer

Your Answer


