javax.persistence (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


Package javax.persistence

The javax.persistence package contains the classes and interfaces that define the contracts between a persistence provider and the managed classes and the clients of the Java Persistence API.

参阅:           详细描述

接口摘要
EntityManager Interface used to interact with the persistence context.
EntityManagerFactory The EntityManagerFactory interface is used by the application to obtain an application-managed entity manager.
EntityTransaction The EntityTransaction interface is used to control resource transactions on resource-local entity managers.
Query Interface used to control query execution.
 

类摘要
Persistence Bootstrap class that is used to obtain an EntityManagerFactory.
 

Enum Summary
CascadeType Defines the set of cascadable operations that are propagated to the associated entity.
DiscriminatorType Defines supported types of the discriminator column.
EnumType Defines mapping for the enumerated types.
FetchType Defines strategies for fetching data from the database.
FlushModeType Flush mode setting.
GenerationType Defines the types of primary key generation.
InheritanceType Defines inheritance strategy options.
LockModeType Lock modes that can be specified by means of the EntityManager.lock() method.
PersistenceContextType Specifies whether a transaction-scoped or extended persistence context is to be used in PersistenceContext.
TemporalType Type used to indicate a specific mapping of Date or Calendar.
 

Exception Summary
EntityExistsException Thrown by the persistence provider when EntityManager.persist(Object) is called and the entity already exists.
EntityNotFoundException Thrown by the persistence provider when an entity reference obtained by EntityManager.getReference(Class,Object) is accessed but the entity does not exist.
NonUniqueResultException Thrown by the persistence provider when getSingleResult() is executed on a query and there is more than one result from the query.
NoResultException Thrown by the persistence provider when getSingleResult() is executed on a query and there is no result to return.
OptimisticLockException Thrown by the persistence provider when an optimistic locking conflict occurs.
PersistenceException Thrown by the persistence provider when a problem occurs.
RollbackException Thrown by the persistence provider when the EntityTransaction.commit() fails.
TransactionRequiredException Thrown by the persistence provider when a transaction is required but is not active.
 

Annotation Types Summary
AssociationOverride This annotation is used to override a many-to-one or one-to-one mapping of property or field for an entity relationship.
AssociationOverrides This annotation is used to override mappings of multiple many-to-one or one-to-one relationship properties or fields.
AttributeOverride The AttributeOverride annotation is used to override the mapping of a Basic (whether explicit or default) property or field or Id property or field.
AttributeOverrides Is used to override mappings of multiple properties or fields.
Basic The Basic annotation is the simplest type of mapping to a database column.
Column Is used to specify a mapped column for a persistent property or field.
ColumnResult References name of a column in the SELECT clause of a SQL query - i.e., column alias, if applicable.
DiscriminatorColumn Is used to define the discriminator column for the SINGLE_TABLE and JOINED inheritance mapping strategies.
DiscriminatorValue Is used to specify the value of the discriminator column for entities of the given type.
Embeddable Defines a class whose instances are stored as an intrinsic part of an owning entity and share the identity of the entity.
Embedded Defines a persistent field or property of an entity whose value is an instance of an embeddable class.
EmbeddedId 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 Specifies that the class is an entity.
EntityListeners Specifies the callback listener classes to be used for an entity or mapped superclass.
EntityResult References an entity in the SELECT clause of a SQL query.
Enumerated Specifies that a persistent property or field should be persisted as a enumerated type.
ExcludeDefaultListeners Specifies that the invocation of default listeners is to be excluded for the entity class (or mapped superclass) and its subclasses.
ExcludeSuperclassListeners Specifies that the invocation of superclass listeners is to be excluded for the entity class (or mapped superclass) and its subclasses.
FieldResult Is used to map the columns specified in the SELECT list of the query to the properties or fields of the entity class.
GeneratedValue Provides for the specification of generation strategies for the values of primary keys.
Id Specifies the primary key property or field of an entity.
IdClass Specifies a composite primary key class that is mapped to multiple fields or properties of the entity.
Inheritance Defines the inheritance strategy to be used for an entity class hierarchy.
JoinColumn Is used to specify a mapped column for joining an entity association.
JoinColumns Defines mapping for the composite foreign keys.
JoinTable This annotation is used in the mapping of associations.
Lob Specifies that a persistent property or field should be persisted as a large object to a database-supported large object type.
ManyToMany Defines a many-valued association with many-to-many multiplicity.
ManyToOne This annotation defines a single-valued association to another entity class that has many-to-one multiplicity.
MapKey Is used to specify the map key for associations of type Map.
MappedSuperclass Designates a class whose mapping information is applied to the entities that inherit from it.
NamedNativeQueries Is used to specify an array of native SQL named queries.
NamedNativeQuery Is used to specify a native SQL named query.
NamedQueries Specifies an array of named Java Persistence query language queries.
NamedQuery Is used to specify a named query in the Java Persistence query language, which is a static query expressed in metadata.
OneToMany Defines a many-valued association with one-to-many multiplicity.
OneToOne This annotation defines a single-valued association to another entity that has one-to-one multiplicity.
OrderBy This annotation specifies the ordering of the elements of a collection valued association at the point when the association is retrieved.
PersistenceContext Expresses a dependency on an EntityManager persistence context.
PersistenceContexts Declares one or more PersistenceContext annotations.
PersistenceProperty Describes a single container or persistence provider property.
PersistenceUnit Expresses a dependency on an EntityManagerFactory.
PersistenceUnits Declares one or more PersistenceUnit annotations.
PostLoad Is used to specify callback methods for the corresponding lifecycle event.
PostPersist Is used to specify callback methods for the corresponding lifecycle event.
PostRemove Is used to specify callback methods for the corresponding lifecycle event.
PostUpdate Is used to specify callback methods for the corresponding lifecycle event.
PrePersist Is used to specify callback methods for the corresponding lifecycle event.
PreRemove Is used to specify callback methods for the corresponding lifecycle event.
PreUpdate Is used to specify callback methods for the corresponding lifecycle event.
PrimaryKeyJoinColumn This annotation specifies a primary key column that is used as a foreign key to join to another table.
PrimaryKeyJoinColumns This annotation groups PrimaryKeyJoinColumn annotations.
QueryHint An implementation-specific Query hint.
SecondaryTable This annotation is used to specify a secondary table for the annotated entity class.
SecondaryTables This annotation is used to specify multiple secondary tables for an entity.
SequenceGenerator This annotation defines a primary key generator that may be referenced by name when a generator element is specified for the GeneratedValue annotation.
SqlResultSetMapping This annotation is used to specify the mapping of the result of a native SQL query.
SqlResultSetMappings This annotation is used to define one or more SqlResultSetMapping.
Table This annotation specifies the primary table for the annotated entity.
TableGenerator This annotation defines a primary key generator that may be referenced by name when a generator element is specified for the GeneratedValue annotation.
Temporal This annotation must be specified for persistent fields or properties of type Date and Calendar.
Transient This annotation specifies that the property or field is not persistent.
UniqueConstraint This annotation is used to specify that a unique constraint is to be included in the generated DDL for a primary or secondary table.
Version This annotation specifies the version field or property of an entity class that serves as its optimistic lock value.
 

Package javax.persistence Description

The javax.persistence package contains the classes and interfaces that define the contracts between a persistence provider and the managed classes and the clients of the Java Persistence API.


Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.