javax.persistence |
|
Java Source File Name | Type | Comment |
AssociationOverride.java | Annotation | This annotation is used to override a many-to-one or
one-to-one mapping of property or field for an entity relationship.
The AssociationOverride annotation may be applied
to an entity that extends a mapped superclass to override a many-to-one
or one-to-one mapping defined by the mapped superclass. |
AssociationOverrides.java | Annotation | This annotation is used to override mappings of multiple
many-to-one or one-to-one relationship properties or fields.
Example:
@MappedSuperclass
public class Employee {
@Id protected Integer id;
@Version protected Integer version;
@ManyToOne protected Address address;
@OneToOne protected Locker locker;
public Integer getId() { ... |
AttributeOverride.java | Annotation | The AttributeOverride annotation is used to
override the mapping of a
Basic (whether explicit or
default) property or field or Id property or field.
The AttributeOverride annotation may be
applied to an entity that extends a mapped superclass or to
an embedded field or property to override a basic mapping
defined by the mapped superclass or embeddable class. |
AttributeOverrides.java | Annotation | Is used to override mappings of multiple properties or fields.
Example:
@Embedded
@AttributeOverrides({
@AttributeOverride(name="startDate", column=@Column("
EMP_START")),
@AttributeOverride(name="endDate", column=@Column("EMP_END"))
})
public EmploymentPeriod getEmploymentPeriod() { ... |
Basic.java | Annotation | The Basic annotation is the simplest type of mapping
to a database column. |
CascadeType.java | enum | Defines the set of cascadable operations that are propagated
to the associated entity. |
Column.java | Annotation | Is used to specify a mapped column for a persistent property or field. |
ColumnResult.java | Annotation | References name of a column in the SELECT clause of a SQL query -
i.e., column alias, if applicable. |
DiscriminatorColumn.java | Annotation | Is used to define the discriminator column for the
InheritanceType.SINGLE_TABLE SINGLE_TABLE and
InheritanceType.JOINED JOINED inheritance mapping strategies.
The strategy and the discriminator column are only
specified in the root of an entity class hierarchy or
subhierarchy in which a different inheritance strategy is applied
If the DiscriminatorColumn annotation is missing,
and a discriminator column is required, the name of the
discriminator column defaults to "DTYPE" and the discriminator
type to
DiscriminatorType.STRING DiscriminatorType.STRING .
Example:
@Entity
@Table(name="CUST")
@Inheritance(strategy=SINGLE_TABLE)
@DiscriminatorColumn(name="DISC", discriminatorType=STRING,length=20)
public class Customer { ... |
DiscriminatorType.java | enum | Defines supported types of the discriminator column. |
DiscriminatorValue.java | Annotation | Is used to specify the value of the discriminator column for
entities of the given type. |
Embeddable.java | Annotation | Defines a class whose instances are stored as an intrinsic
part of an owning entity and share the identity of the entity. |
Embedded.java | Annotation | Defines a persistent field or property of an entity whose
value is an instance of an embeddable class. |
EmbeddedId.java | Annotation | Is 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. |
Entity.java | Annotation | Specifies that the class is an entity. |
EntityExistsException.java | Class | Thrown by the persistence provider when
EntityManager.persist(Object) EntityManager.persist(Object) is called and the entity
already exists. |
EntityListeners.java | Annotation | Specifies the callback listener classes to be used for an
entity or mapped superclass. |
EntityManager.java | Interface | Interface used to interact with the persistence context.
An EntityManager instance is associated with
a persistence context. |
EntityManagerFactory.java | Interface | The EntityManagerFactory interface is used
by the application to obtain an application-managed entity
manager. |
EntityNotFoundException.java | Class | Thrown by the persistence provider when an entity reference obtained by
EntityManager.getReference EntityManager.getReference(Class,Object) is accessed but the entity does not exist. |
EntityResult.java | Annotation | References an entity in the SELECT clause of a SQL query.
If this annotation is used, the SQL statement should select
all of the columns that are mapped to the entity object. |
EntityTransaction.java | Interface | The EntityTransaction interface is used to control
resource transactions on resource-local entity managers. |
Enumerated.java | Annotation | Specifies that a persistent property or field should be
persisted as a enumerated type. |
EnumType.java | enum | Defines mapping for the enumerated types. |
ExcludeDefaultListeners.java | Annotation | Specifies that the invocation of default listeners is
to be excluded for the entity class (or mapped superclass)
and its subclasses. |
ExcludeSuperclassListeners.java | Annotation | Specifies that the invocation of superclass listeners is
to be excluded for the entity class (or mapped superclass)
and its subclasses. |
FetchType.java | enum | Defines strategies for fetching data from the database.
The EAGER strategy is a requirement on the persistence
provider runtime that data must be eagerly fetched. |
FieldResult.java | Annotation | Is used to map the columns specified in the SELECT list
of the query to the properties or fields of the entity class. |
FlushModeType.java | enum | Flush mode setting.
When queries are executed within a transaction, if
FlushModeType.AUTO is set on the
Query
object, or if the flush mode setting for the persistence context
is AUTO (the default) and a flush mode setting has
not been specified for the
Query object, the persistence
provider is responsible for ensuring that all updates to the state
of all entities in the persistence context which could potentially
affect the result of the query are visible to the processing
of the query. |
GeneratedValue.java | Annotation | Provides for the specification of generation strategies for
the values of primary keys. |
GenerationType.java | enum | Defines the types of primary key generation. |
Id.java | Annotation | Specifies the primary key property or field of an entity. |
IdClass.java | Annotation | Specifies a composite primary key class that is mapped to
multiple fields or properties of the entity. |
Inheritance.java | Annotation | Defines the inheritance strategy to be used for an entity class
hierarchy. |
InheritanceType.java | enum | Defines inheritance strategy options. |
JoinColumn.java | Annotation | Is used to specify a mapped column for joining an entity association. |
JoinColumns.java | Annotation | Defines mapping for the composite foreign keys. |
JoinTable.java | Annotation | This annotation is used in the mapping of associations. |
Lob.java | Annotation | Specifies that a persistent property or field should be persisted
as a large object to a database-supported large object type. |
LockModeType.java | enum | Lock modes that can be specified by means of the
EntityManager.lock EntityManager.lock() method.
The semantics of requesting locks of type
LockModeType.READ LockModeType.READ and
LockModeType.WRITE LockModeType.WRITE are the following.
If transaction T1 calls lock(entity,
LockModeType.READ LockModeType.READ ) on a versioned object,
the entity manager must ensure that neither of the following
phenomena can occur:
- P1 (Dirty read): Transaction T1 modifies a row.
|
ManyToMany.java | Annotation | Defines a many-valued association with many-to-many multiplicity. |
ManyToOne.java | Annotation | This annotation defines a single-valued association to another
entity class that has many-to-one multiplicity. |
MapKey.java | Annotation | Is used to specify the map key for associations of type
java.util.Map .
If a persistent field or property other than the primary
key is used as a map key then it is expected to have a
uniqueness constraint associated with it.
Example 1:
@Entity
public class Department {
...
@OneToMany(mappedBy="department")
@MapKey(name="empId")
public Map getEmployees() {... |
MappedSuperclass.java | Annotation | Designates a class whose mapping information is applied
to the entities that inherit from it. |
NamedNativeQueries.java | Annotation | Is used to specify an array of native SQL named queries. |
NamedNativeQuery.java | Annotation | Is used to specify a native SQL named query. |
NamedQueries.java | Annotation | Specifies an array of named Java Persistence query language queries. |
NamedQuery.java | Annotation | Is used to specify a named query in the Java Persistence query language,
which is a static query expressed in metadata. |
NonUniqueResultException.java | Class | Thrown by the persistence provider when
Query.getSingleResult getSingleResult() is executed on a query and there is more
than one result from the query. |
NoResultException.java | Class | Thrown by the persistence provider when
Query.getSingleResult getSingleResult() is executed on a query
and there is no result to return. |
OneToMany.java | Annotation | Defines a many-valued association with one-to-many multiplicity. |
OneToOne.java | Annotation | This annotation defines a single-valued association to
another entity that has one-to-one multiplicity. |
OptimisticLockException.java | Class | Thrown by the persistence provider when an optimistic locking conflict
occurs. |
OrderBy.java | Annotation | This annotation specifies the ordering of the elements of a
collection valued association at the point when the association
is retrieved.
The syntax of the value ordering element is an
orderby_list , as follows:
orderby_list::= orderby_item [,orderby_item]*
orderby_item::= property_or_field_name [ASC | DESC]
If ASC or DESC is not specified,
ASC (ascending order) is assumed.
If the ordering element is not specified, ordering by
the primary key of the associated entity is assumed.
The property or field name must correspond to that of a
persistent property or field of the associated class. |
Persistence.java | Class | Bootstrap class that is used to obtain an
EntityManagerFactory . |
PersistenceContext.java | Annotation | Expresses a dependency on an
EntityManager persistence context. |
PersistenceContexts.java | Annotation | Declares one or more
PersistenceContext annotations. |
PersistenceContextType.java | enum | Specifies whether a transaction-scoped or extended
persistence context is to be used in
PersistenceContext . |
PersistenceException.java | Class | Thrown by the persistence provider when a problem occurs. |
PersistenceProperty.java | Annotation | Describes a single container or persistence provider property.
Vendor specific properties may be included in the set of
properties, and are passed to the persistence provider by the
container when the entity manager is created. |
PersistenceUnit.java | Annotation | Expresses a dependency on an
EntityManagerFactory . |
PersistenceUnits.java | Annotation | Declares one or more
PersistenceUnit annotations. |
PostLoad.java | Annotation | Is used to specify callback methods for the corresponding
lifecycle event. |
PostPersist.java | Annotation | Is used to specify callback methods for the corresponding
lifecycle event. |
PostRemove.java | Annotation | Is used to specify callback methods for the corresponding
lifecycle event. |
PostUpdate.java | Annotation | Is used to specify callback methods for the corresponding
lifecycle event. |
PrePersist.java | Annotation | Is used to specify callback methods for the corresponding
lifecycle event. |
PreRemove.java | Annotation | Is used to specify callback methods for the corresponding
lifecycle event. |
PreUpdate.java | Annotation | Is used to specify callback methods for the corresponding
lifecycle event. |
PrimaryKeyJoinColumn.java | Annotation | This annotation specifies a primary key column that is used
as a foreign key to join to another table. |
PrimaryKeyJoinColumns.java | Annotation | This annotation groups
PrimaryKeyJoinColumn annotations.
It is used to map composite foreign keys.
Example 1: ValuedCustomer subclass
@Entity
@Table(name="VCUST")
@DiscriminatorValue("VCUST")
@PrimaryKeyJoinColumns({
@PrimaryKeyJoinColumn(name="CUST_ID",
referencedColumnName="ID"),
@PrimaryKeyJoinColumn(name="CUST_TYPE",
referencedColumnName="TYPE")
})
public class ValuedCustomer extends Customer { ... |
Query.java | Interface | Interface used to control query execution. |
QueryHint.java | Annotation | An implementation-specific
Query hint. |
RollbackException.java | Class | Thrown by the persistence provider when the
EntityTransaction.commit EntityTransaction.commit() fails. |
SecondaryTable.java | Annotation | This annotation is used to specify a secondary table for
the annotated entity class. |
SecondaryTables.java | Annotation | This annotation is used to specify multiple secondary tables
for an entity.
Example 1: Multiple secondary tables assuming primary key columns are named the same in all tables.
@Entity
@Table(name="EMPLOYEE")
@SecondaryTables({
@SecondaryTable(name="EMP_DETAIL"),
@SecondaryTable(name="EMP_HIST")
})
public class Employee { ... |
SequenceGenerator.java | Annotation | This annotation defines a primary key generator that may
be referenced by name when a generator element is specified
for the
GeneratedValue annotation. |
SqlResultSetMapping.java | Annotation | This annotation is used to specify the mapping of the result
of a native SQL query. |
SqlResultSetMappings.java | Annotation | This annotation is used to define one or more
SqlResultSetMapping . |
Table.java | Annotation | This annotation specifies the primary table for the annotated
entity. |
TableGenerator.java | Annotation | This annotation defines a primary key generator that may be
referenced by name when a generator element is specified for
the
GeneratedValue annotation. |
Temporal.java | Annotation | This annotation must be specified for persistent fields
or properties of type
java.util.Date and
java.util.Calendar . |
TemporalType.java | enum | Type used to indicate a specific mapping of
java.util.Date
or
java.util.Calendar . |
TransactionRequiredException.java | Class | Thrown by the persistence provider when a transaction is required but is not
active. |
Transient.java | Annotation | This annotation specifies that the property or field is
not persistent. |
UniqueConstraint.java | Annotation | This annotation is used to specify that a unique constraint
is to be included in the generated DDL for a primary or secondary table.
Example:
@Entity
@Table(
name="EMPLOYEE",
uniqueConstraints=
@UniqueConstraint(columnNames={"EMP_ID", "EMP_NAME"})
)
public class Employee { ... |
Version.java | Annotation | This annotation specifies the version field or property of
an entity class that serves as its optimistic lock value. |