Enterprise JavaBeans 3 Persistence

Table of Contents

1. Introduction
1.1. Intended Audience
1.2. Lightweight Persistence
2. Why EJB Persistence?
3. EJB Persistence Architecture
3.1. EJB Exceptions
4. Entity
4.1. Restrictions on Persistent Classes
4.1.1. Default or No-Arg Constructor
4.1.2. Final
4.1.3. Identity Fields
4.1.4. Version Field
4.1.5. Inheritance
4.1.6. Persistent Fields
4.1.7. Conclusions
4.2. Entity Identity
4.2.1. Identity Class
4.2.1.1. Identity Hierarchies
4.3. Lifecycle Callbacks
4.3.1. Callback Methods
4.3.2. Using Callback Methods
4.3.3. Using Entity Listeners
4.3.4. Entity Listeners Hierarchy
4.4. Conclusions
5. Metadata
5.1. XML MetaData
5.2. Class Annotations
5.2.1. Entity
5.2.2. IdClass
5.2.3. MappedSuperclass
5.2.4. Embeddable
5.2.5. EntityListeners
5.2.6. Example
5.3. Field and Property Annotations
5.3.1. Transient
5.3.2. Id
5.3.3. GeneratedValue
5.3.4. Version
5.3.5. Basic
5.3.5.1. FetchType
5.3.6. Embedded
5.3.7. ManyToOne
5.3.7.1. CascadeType
5.3.8. OneToMany
5.3.8.1. Bidirectional Relations
5.3.9. OneToOne
5.3.10. ManyToMany
5.3.11. OrderBy
5.3.12. MapKey
5.3.13. Persistent Field Defaults
5.4. Conclusion
6. Persistence
6.1. persistence.xml
6.2. Non-EE Use
7. EntityManagerFactory
7.1. Obtaining an EntityManagerFactory
7.2. Obtaining EntityManagers
7.3. Persistence Context
7.3.1. Transaction Persistence Context
7.3.2. Extended Persistence Context
7.4. Closing the EntityManagerFactory
8. EntityManager
8.1. Transaction Association
8.2. Entity Lifecycle Management
8.3. Lifecycle Examples
8.4. Entity Identity Management
8.5. Cache Management
8.6. Query Factory
8.7. Closing
9. Transaction
9.1. Transaction Types
9.2. The EntityTransaction Interface
10. EJB Query
10.1. Query Basics
10.2. Relation Traversal
10.3. Fetch Joins
10.4. EJBQL Functions
10.5. Polymorphic Queries
10.6. Query Parameters
10.7. Ordering
10.8. Aggregates
10.9. Named Queries
10.10. Delete By Query
10.11. Update By Query
11. SQL Queries
11.1. Creating SQL Queries
11.2. Retrieving Persistent Objects with SQL
12. Mapping Metadata
12.1. Table
12.2. Unique Constraints
12.3. Column
12.4. Identity Mapping
12.5. Generators
12.5.1. SequenceGenerator
12.5.2. TableGenerator
12.5.3. Example
12.6. Inheritance
12.6.1. Single Table
12.6.1.1. Advantages
12.6.1.2. Disadvantages
12.6.2. Joined
12.6.2.1. Advantages
12.6.2.2. Disadvantages
12.6.3. Table Per Class
12.6.3.1. Advantages
12.6.3.2. Disadvantages
12.6.4. Putting it All Together
12.7. Discriminator
12.8. Field Mapping
12.8.1. Basic Mapping
12.8.1.1. LOBs
12.8.1.2. Enumerated
12.8.1.3. Temporal Types
12.8.1.4. The Updated Mappings
12.8.2. Secondary Tables
12.8.3. Embedded Mapping
12.8.4. Direct Relations
12.8.5. Join Table
12.8.6. Bidirectional Mapping
12.8.7. Map Mapping
12.9. The Complete Mappings
13. Conclusion