(1) JPA, Hibernate and mapping rules

JPA

  Java Persistence API [JPA] is Java Sun Crown persistence specification that provides object / relational mapping tools to manage relational data in Java applications.
  Achieve Hibernate, EclipseLink [former] toplink, OpenJPA are all of JPA.

Hibernate implementation of JPA

  As an implementation of JPA Hibernate, JPA annotations have been the core of Hibernate.
  Hibernate only provides some complementary, rather than generating sets with JPA annotations.
  We recommend using JPA's own annotations.

Mapping rules

(1) The entity class must @ javax.persistence.Entity    
(2) the primary key attribute must @ javax.persistence.Id
(. 3) such entities must have a public or protected in the no-argument constructor function
(4) entity class can not be final type, can not have final type of process
(5) If an instance of the entity class need to call (e.g., a remote call) manner pass value, then the entity class implement java.io.Serializable

Guess you like

Origin www.cnblogs.com/abdusalam10/p/11907466.html