Package jakarta.persistence
package jakarta.persistence
Jakarta Persistence is the API for the management for persistence and object/relational mapping.
-
ClassDescriptionUsed to specify an access type to be applied to an entity class, mapped superclass, or embeddable class, or to a specific attribute of such a class.Used with the
Access
annotation to specify an access type to be applied to an entity class, mapped superclass, or embeddable class, or to a specific attribute of such a class.Used to override a mapping for an entity relationship.Used to override mappings of multiple relationship properties or fields.AttributeConverter<X,Y> A class that implements this interface can be used to convert entity attribute state into database column representation and back again.Represents an attribute node of an entity graph.Used to override the mapping of aBasic
(whether explicit or default) property or field orId
property or field.Used to override mappings of multiple properties or fields.The simplest type of mapping to a database column.Interface used to interact with the second-level cache.Specifies whether an entity should be cached if caching is enabled when the value of thepersistence.xml
caching element isENABLE_SELECTIVE
orDISABLE_SELECTIVE
.Used as the value of thejakarta.persistence.cache.retrieveMode
property to specify the behavior when data is retrieved by thefind
methods and by queries.Used as the value of thejakarta.persistence.cache.storeMode
property to specify the behavior when data is read from the database and when data is committed into the database.Defines the set of cascadable operations that are propagated to the associated entity.Specifies the table that is used for the mapping of collections of basic or embeddable types.Specifies the mapped column for a persistent property or field.Used in conjunction with theSqlResultSetMapping
annotation orConstructorResult
annotation to map a column of the SELECT list of a SQL query.Used to control the application of a constraint.Used in conjunction with theSqlResultSetMapping
annotation to map the SELECT clause of a SQL query to a constructor.Specifies the conversion of a Basic field or property.Specifies that the annotated class is a converter and defines its scope.Used to groupConvert
annotations.Defines supported types of the discriminator column.Specifies the value of the discriminator column for entities of the given type.Specifies a collection of instances of a basic type or embeddable class.Specifies a class whose instances are stored as an intrinsic part of an owning entity and share the identity of the entity.Specifies a persistent field or property of an entity whose value is an instance of an embeddable class.Applied to a persistent field or property of an entity class or mapped superclass to denote a composite primary key that is an embeddable class.Specifies that the class is an entity.Thrown by the persistence provider whenEntityManager.persist(Object)
is called and the entity already exists.EntityGraph<T>This type represents the root of an entity graph that will be used as a template to define the attribute nodes and boundaries of a graph of entities and entity relationships.Specifies the callback listener classes to be used for an entity or mapped superclass.Interface used to interact with the persistence context.Interface used to interact with the entity manager factory for the persistence unit.Thrown by the persistence provider when an entity reference obtained byEntityManager.getReference
is accessed but the entity does not exist.Used in conjunction with theSqlResultSetMapping
annotation to map the SELECT clause of a SQL query to an entity result.Interface used to control transactions on resource-local entity managers.Specifies that a persistent property or field should be persisted as a enumerated type.Defines mapping for enumerated types.Specifies that the invocation of default listeners is to be excluded for the entity class (or mapped superclass) and its subclasses.Specifies that the invocation of superclass listeners is to be excluded for the entity class (or mapped superclass) and its subclasses.Defines strategies for fetching data from the database.Used in conjunction with theEntityResult
annotation to map columns specified in the SELECT list of a SQL query to the properties or fields of an entity class.Flush mode setting.Used to specify the handling of foreign key constraints when schema generation is in effect.Provides for the specification of generation strategies for the values of primary keys.Defines the types of primary key generation strategies.Specifies the primary key of an entity.Specifies a composite primary key class that is mapped to multiple fields or properties of the entity.Used in schema generation to specify creation of an index.Specifies the inheritance strategy to be used for an entity class hierarchy.Defines inheritance strategy options.Specifies a column for joining an entity association or element collection.Specifies the mapping for composite foreign keys.Specifies the mapping of associations.Specifies that a persistent property or field should be persisted as a large object to a database-supported large object type.Lock modes can be specified by means of passing aLockModeType
argument to one of theEntityManager
methods that take locks (lock
,find
, orrefresh
) or to theQuery.setLockMode()
orTypedQuery.setLockMode()
method.Thrown by the persistence provider when an pessimistic locking conflict occurs that does not result in transaction rollback.Specifies a many-valued association with many-to-many multiplicity.Specifies a single-valued association to another entity class that has many-to-one multiplicity.Specifies the map key for associations of typejava.util.Map
when the map key is itself the primary key or a persistent field or property of the entity that is the value of the map.Specifies the type of the map key for associations of typejava.util.Map
.Specifies the mapping for the key column of a map whose map key is a basic type.Specifies the enum type for a map key whose basic type is an enumerated type.Specifies a mapping to an entity that is a map key.Supports composite map keys that reference entities.Designates a class whose mapping information is applied to the entities that inherit from it.Designates aManyToOne
orOneToOne
relationship attribute that provides the mapping for anEmbeddedId
primary key, an attribute within anEmbeddedId
primary key, or a simple primary key of the parent entity.ANamedAttributeNode
is a member element of aNamedEntityGraph
.Used to specify the path and boundaries for a find operation or query.Used to groupNamedEntityGraph
annotations.Specifies multiple native SQL named queries.Specifies a named native SQL query.Specifies multiple named Jakarta Persistence query language queries.Specifies a static, named query in the Jakarta Persistence query language.Specifies multiple named stored procedure queries.Specifies and names a stored procedure, its parameters, and its result type.ANamedSubgraph
is a member element of aNamedEntityGraph
.Thrown by the persistence provider whenQuery.getSingleResult()
orTypedQuery.getSingleResult()
is executed on a query and there is more than one result from the query.Thrown by the persistence provider whenQuery.getSingleResult()
orTypedQuery.getSingleResult()
is executed on a query and there is no result to return.Specifies a many-valued association with one-to-many multiplicity.Specifies a single-valued association to another entity that has one-to-one multiplicity.Thrown by the persistence provider when an optimistic locking conflict occurs.Specifies the ordering of the elements of a collection valued association or element collection at the point when the association or collection is retrieved.Specifies a column that is used to maintain the persistent order of a list.Parameter<T>Type for query parameter objects.Specifies the mode of a parameter of a stored procedure query.Bootstrap class that is used to obtain anEntityManagerFactory
in Java SE environments.Expresses a dependency on a container-managedEntityManager
and its associated persistence context.Declares one or morePersistenceContext
annotations.Specifies whether a transaction-scoped or extended persistence context is to be used inPersistenceContext
.Thrown by the persistence provider when a problem occurs.Describes a single container or persistence provider property.Expresses a dependency on anEntityManagerFactory
and its associated persistence unit.Declares one or morePersistenceUnit
annotations.Utility interface between the application and the persistence provider managing the persistence unit.Utility interface between the application and the persistence provider(s).Thrown by the persistence provider when an pessimistic locking conflict occurs.Defines the values of thejakarta.persistence.lock.scope
property for pessimistic locking.Specifies a callback method for the corresponding lifecycle event.Specifies a callback method for the corresponding lifecycle event.Specifies a callback method for the corresponding lifecycle event.Specifies a callback method for the corresponding lifecycle event.Specifies a callback method for the corresponding lifecycle event.Specifies a callback method for the corresponding lifecycle event.Specifies a callback method for the corresponding lifecycle event.Specifies a primary key column that is used as a foreign key to join to another table.GroupsPrimaryKeyJoinColumn
annotations.Interface used to control query execution.Used to supply a query property or hint to theNamedQuery
orNamedNativeQuery
annotation.Thrown by the persistence provider when a query times out and only the statement is rolled back.Thrown by the persistence provider whenEntityTransaction.commit()
fails.Specifies a secondary table for the annotated entity class.Specifies multiple secondary tables for an entity.Defines a primary key generator that may be referenced by name when a generator element is specified for theGeneratedValue
annotation.Used to groupSequenceGenerator
annotations.Specifies how the provider must use a second-level cache for the persistence unit.Specifies the mapping of the result of a native SQL query or stored procedure.Is used to define one or moreSqlResultSetMapping
annotations.Specifies a parameter of a named stored procedure query.Interface used to control stored procedure query execution.Subgraph<T>This type represents a subgraph for an attribute node that corresponds to a Managed Type.Specifies whether the persistence context is always automatically synchronized with the current transaction or whether the persistence context must be explicitly joined to the current transaction by means of theEntityManager.joinTransaction()
method.Specifies the primary table for the annotated entity.Defines a primary key generator that may be referenced by name when a generator element is specified for theGeneratedValue
annotation.Used to groupTableGenerator
annotations.This annotation must be specified for persistent fields or properties of typejava.util.Date
andjava.util.Calendar
.Type used to indicate a specific mapping ofjava.util.Date
orjava.util.Calendar
.Thrown by the persistence provider when a transaction is required but is not active.Specifies that the property or field is not persistent.Interface for extracting the elements of a query result tuple.TupleElement<X>TheTupleElement
interface defines an element that is returned in a query result tuple.TypedQuery<X>Interface used to control the execution of typed queries.Specifies that a unique constraint is to be included in the generated DDL for a primary or secondary table.The validation mode to be used by the provider for the persistence unit.Specifies the version field or property of an entity class that serves as its optimistic lock value.