JPA and Hibernate Difference

JPA is a specification for accessing, persisting and managing the data between Java objects and the relational database. As the definition says its API, it is only the specification. There is no implementation for the API. JPA specifies the set of rules and guidelines for developing the interfaces
JPA is just guidelines to implement the Object Relational Mapping (ORM)  and there is no underlying code for the implementation.


 Hibernate is the actual implementation of JPA guidelines. When hibernate implements the JPA specification.
Hibernate is a JPA provider. When there is new changes to the specification, hibernate would release its updated implementation for the JPA specification. Other popular JPA providers are Eclipse Link (Reference Implementation), OpenJPA, etc

JPA is not an implementation, it will not provide any concrete functionality to your application.  Its purpose is to provide a set of rules and guidelines that can be followed by JPA implementation vendors to create an ORM implementation in a standardized manner. 

Hibernate JPA Annotations - Contents:

AnnotationPackage Detail/Import statement
@Entityimport javax.persistence.Entity;
@Tableimport javax.persistence.Table;
@Columnimport javax.persistence.Column;
@Idimport javax.persistence.Id;
@GeneratedValueimport javax.persistence.GeneratedValue;
@Versionimport javax.persistence.Version;
@OrderByimport javax.persistence.OrderBy;
@Transientimport javax.persistence.Transient;
@Lobimport javax.persistence.Lob;
Hibernate Association Mapping Annotations
@OneToOneimport javax.persistence.OneToOne;
@ManyToOneimport javax.persistence.ManyToOne;
@OneToManyimport javax.persistence.OneToMany;
@ManyToManyimport javax.persistence.ManyToMany;
@PrimaryKeyJoinColumnimport javax.persistence.PrimaryKeyJoinColumn;
@JoinColumnimport javax.persistence.JoinColumn;
@JoinTableimport javax.persistence.JoinTable;
@MapsIdimport javax.persistence.MapsId;
Hibernate Inheritance Mapping Annotations
@Inheritanceimport javax.persistence.Inheritance;
@DiscriminatorColumnimport javax.persistence.DiscriminatorColumn;
@DiscriminatorValueimport javax.persistence.DiscriminatorValue;




Comments