Java Persistence API
lastmod 2024-12-05created 2015-04-259 edits
The Java Persistence API (JPA) provides a standard ORM technology for accessing relational databases, and replaces the Entity Bean previously provided by EJB. JPA is defined as part of the EJB 3.0 specification defined in JSR 220, but JPA does not depend on an EJB container and can be used in EJB, web modules, and Java SE clients alike. JPA also lets users choose and use the persistence provider implementation they want.
Annotations
-
@Entity - Indicates that the domain object is used as an entity.
-
@Id - Defines the Id of the entity. An Id is mandatory.
-
@GeneratedValue - Defines how the Id value is generated. GenerationType.AUTO means automatic generation.
See also
Favorite site
- Description of JPA
- SpringDataJPA - Spring Camp
- [Recommended] Introduction to JPA, how to use it, and integration with the Spring framework
- Integrating with Mysql using JPA
- Using Spring-Data-JPA
- [Recommended] spring boot + spring-data-jpa configuration
- Spring Boot: simple RestAPI and JPA example
- Ditch JPA/Hibernate | GeekNews