Skip to content
Search

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

author Zer0 sitemap