javax.persistence

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » toplink » javax.persistence 
javax.persistence
Java Source File NameTypeComment
AssociationOverride.javaAnnotation 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.javaAnnotation 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.javaAnnotation 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.javaAnnotation 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.javaAnnotation The Basic annotation is the simplest type of mapping to a database column.
CascadeType.javaenum Defines the set of cascadable operations that are propagated to the associated entity.
Column.javaAnnotation Is used to specify a mapped column for a persistent property or field.
ColumnResult.javaAnnotation References name of a column in the SELECT clause of a SQL query - i.e., column alias, if applicable.
DiscriminatorColumn.javaAnnotation 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.javaenum Defines supported types of the discriminator column.
DiscriminatorValue.javaAnnotation Is used to specify the value of the discriminator column for entities of the given type.
Embeddable.javaAnnotation Defines a class whose instances are stored as an intrinsic part of an owning entity and share the identity of the entity.
Embedded.javaAnnotation Defines a persistent field or property of an entity whose value is an instance of an embeddable class.
EmbeddedId.javaAnnotation 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.javaAnnotation Specifies that the class is an entity.
EntityExistsException.javaClass Thrown by the persistence provider when EntityManager.persist(Object) EntityManager.persist(Object) is called and the entity already exists.
EntityListeners.javaAnnotation Specifies the callback listener classes to be used for an entity or mapped superclass.
EntityManager.javaInterface Interface used to interact with the persistence context.

An EntityManager instance is associated with a persistence context.

EntityManagerFactory.javaInterface The EntityManagerFactory interface is used by the application to obtain an application-managed entity manager.
EntityNotFoundException.javaClass 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.javaAnnotation 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.javaInterface The EntityTransaction interface is used to control resource transactions on resource-local entity managers.
Enumerated.javaAnnotation Specifies that a persistent property or field should be persisted as a enumerated type.
EnumType.javaenum Defines mapping for the enumerated types.
ExcludeDefaultListeners.javaAnnotation Specifies that the invocation of default listeners is to be excluded for the entity class (or mapped superclass) and its subclasses.
ExcludeSuperclassListeners.javaAnnotation Specifies that the invocation of superclass listeners is to be excluded for the entity class (or mapped superclass) and its subclasses.
FetchType.javaenum 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.javaAnnotation Is used to map the columns specified in the SELECT list of the query to the properties or fields of the entity class.
FlushModeType.javaenum 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.javaAnnotation Provides for the specification of generation strategies for the values of primary keys.
GenerationType.javaenum Defines the types of primary key generation.
Id.javaAnnotation Specifies the primary key property or field of an entity.
IdClass.javaAnnotation Specifies a composite primary key class that is mapped to multiple fields or properties of the entity.
Inheritance.javaAnnotation Defines the inheritance strategy to be used for an entity class hierarchy.
InheritanceType.javaenum Defines inheritance strategy options.
JoinColumn.javaAnnotation Is used to specify a mapped column for joining an entity association.
JoinColumns.javaAnnotation Defines mapping for the composite foreign keys.
JoinTable.javaAnnotation This annotation is used in the mapping of associations.
Lob.javaAnnotation Specifies that a persistent property or field should be persisted as a large object to a database-supported large object type.
LockModeType.javaenum 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.javaAnnotation Defines a many-valued association with many-to-many multiplicity.
ManyToOne.javaAnnotation This annotation defines a single-valued association to another entity class that has many-to-one multiplicity.
MapKey.javaAnnotation 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.javaAnnotation Designates a class whose mapping information is applied to the entities that inherit from it.
NamedNativeQueries.javaAnnotation Is used to specify an array of native SQL named queries.
NamedNativeQuery.javaAnnotation Is used to specify a native SQL named query.
NamedQueries.javaAnnotation Specifies an array of named Java Persistence query language queries.
NamedQuery.javaAnnotation Is used to specify a named query in the Java Persistence query language, which is a static query expressed in metadata.
NonUniqueResultException.javaClass 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.javaClass Thrown by the persistence provider when Query.getSingleResult getSingleResult() is executed on a query and there is no result to return.
OneToMany.javaAnnotation Defines a many-valued association with one-to-many multiplicity.
OneToOne.javaAnnotation This annotation defines a single-valued association to another entity that has one-to-one multiplicity.
OptimisticLockException.javaClass Thrown by the persistence provider when an optimistic locking conflict occurs.
OrderBy.javaAnnotation 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.javaClass Bootstrap class that is used to obtain an EntityManagerFactory .
PersistenceContext.javaAnnotation Expresses a dependency on an EntityManager persistence context.
PersistenceContexts.javaAnnotation Declares one or more PersistenceContext annotations.
PersistenceContextType.javaenum Specifies whether a transaction-scoped or extended persistence context is to be used in PersistenceContext .
PersistenceException.javaClass Thrown by the persistence provider when a problem occurs.
PersistenceProperty.javaAnnotation 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.javaAnnotation Expresses a dependency on an EntityManagerFactory .
PersistenceUnits.javaAnnotation Declares one or more PersistenceUnit annotations.
PostLoad.javaAnnotation Is used to specify callback methods for the corresponding lifecycle event.
PostPersist.javaAnnotation Is used to specify callback methods for the corresponding lifecycle event.
PostRemove.javaAnnotation Is used to specify callback methods for the corresponding lifecycle event.
PostUpdate.javaAnnotation Is used to specify callback methods for the corresponding lifecycle event.
PrePersist.javaAnnotation Is used to specify callback methods for the corresponding lifecycle event.
PreRemove.javaAnnotation Is used to specify callback methods for the corresponding lifecycle event.
PreUpdate.javaAnnotation Is used to specify callback methods for the corresponding lifecycle event.
PrimaryKeyJoinColumn.javaAnnotation This annotation specifies a primary key column that is used as a foreign key to join to another table.
PrimaryKeyJoinColumns.javaAnnotation 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.javaInterface Interface used to control query execution.
QueryHint.javaAnnotation An implementation-specific Query hint.
RollbackException.javaClass Thrown by the persistence provider when the EntityTransaction.commit EntityTransaction.commit() fails.
SecondaryTable.javaAnnotation This annotation is used to specify a secondary table for the annotated entity class.
SecondaryTables.javaAnnotation 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.javaAnnotation This annotation defines a primary key generator that may be referenced by name when a generator element is specified for the GeneratedValue annotation.
SqlResultSetMapping.javaAnnotation This annotation is used to specify the mapping of the result of a native SQL query.
SqlResultSetMappings.javaAnnotation This annotation is used to define one or more SqlResultSetMapping .
Table.javaAnnotation This annotation specifies the primary table for the annotated entity.
TableGenerator.javaAnnotation This annotation defines a primary key generator that may be referenced by name when a generator element is specified for the GeneratedValue annotation.
Temporal.javaAnnotation This annotation must be specified for persistent fields or properties of type java.util.Date and java.util.Calendar .
TemporalType.javaenum Type used to indicate a specific mapping of java.util.Date or java.util.Calendar .
TransactionRequiredException.javaClass Thrown by the persistence provider when a transaction is required but is not active.
Transient.javaAnnotation This annotation specifies that the property or field is not persistent.
UniqueConstraint.javaAnnotation 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.javaAnnotation This annotation specifies the version field or property of an entity class that serves as its optimistic lock value.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.