Table of Contents
- Title and Copyright Information
- Preface
- What's New in This Guide
- 1 Introduction
- 2 Installing Oracle TopLink
- 
               
               
                  
                  3
                      Using TopLink with WebLogic Server
               
                  
               
               
               - Introduction to the Solution
- 
                     
                     Implementing the Solution
                        
                     
                     
                     - Task 1: Prerequisites
- Optional Task: Update the Release of EclipseLink in WebLogic Server (Optional)
- Task 3: Configure JMX MBean Extensions in WebLogic Server
- Task 4: Use or Reconfigure the Logging Integration
- Task 5: Add Persistence to Your Java Application Using EclipseLink
- 
                           
                           Task 6: Configure a Data Source
                              
                           
                           
                           - Ways to Configure Data Sources for JPA Applications
- Configure a Globally Scoped JTA Data Source
- Create the Data Source in WebLogic Server
- Configure the persistence.xml File
- Configure an Application-Scoped JTA Data Source
- Specify that the Data Source Is Application-Scoped
- Add the JDBC Module to the WebLogic Server Application Configuration
- Configure the JPA Persistence Unit to Use the JTA Data Source
- Configure a non-JTA Data Source and Manage Transactions in the Application
- Ensure the Settings Match
 
- Task 7: Extend the Domain to Use Advanced Oracle Database Features
- Task 8: Start WebLogic Server and Deploy the Application
- Task 9: Run the Application
- Task 10: Configure and Monitor Persistence Settings in WebLogic Server
 
- Additional Resources
 
- 
               
               
                  
                  4
                      Using TopLink with GlassFish Server 
               
                  
               
               
               - Introduction to the Solution
- 
                     
                     Implementing the Solution
                        
                     
                     
                     - Task 1: Prerequisites
- Task 2: Install GlassFish Server
- Task 3: Set Up the Data Source
- Task 4: Create the persistence.xml File
- Task 5: Set Up GlassFish Server for JPA
- Task 6: Create the Application
- Task 7: Deploy the Application to GlassFish Server
- Task 8: Run the Application
- Task 9: Monitor the Application
 
- Additional Resources
 
- 5 Using TopLink with JBoss 7 Application Server
- 6 Using TopLink with IBM WebSphere Application Server
- 7 Migrating from Native TopLink
- 
               
               
                  
                  8
                      Migrating from Hibernate to TopLink 
               
                  
               
               
               - Introduction to the Solution
- Main Tasks
- Additional Resources
 
- 9 Using Multiple Databases with a Composite Persistence Unit
- 
               
               
                  
                  10
                      Scaling Applications in Clusters 
               
                  
               
               
               - Introduction to the Solution
- 
                     
                     Implementing the Solution
                        
                     
                     
                     - 
                           
                           Task 1: Configure Cache Consistency
                              
                           
                           
                           - Disabling Entity Caching
- Refreshing the Cache
- Setting Entity Caching Expiration
- Setting Optimistic Locking
- Using Cache Coordination
- Setting Cache Synchronization
- Configuring JMS Cache Coordination Using Persistence Properties
- Configuring RMI Cache Coordination Using Persistence Properties
- Cache Coordination and Oracle WebLogic
- Cache Coordination and Glassfish
- Cache Coordination and IBM WebSphere
- Configuring Cache Coordination Using the Cache Coordination API
 
- Task 2: Ensure EclipseLink Is Enabled
- Task 3: Ensure All Application Servers Are Part of the Cluster
- Using Data Partitioning to Scale Data
 
- 
                           
                           Task 1: Configure Cache Consistency
                              
                           
                           
                           
- Additional Resources
 
- 11 Providing Software as a Service
- 
               
               
                  
                  12
                      Making JPA Entities and JAXB Beans Extensible
               
                  
               
               
               - 
                     
                     Making JPA Entities Extensible
                        
                     
                     
                     - 
                           
                           Main Tasks for Creating and Supporting an Extensible JPA Entity
                              
                           
                           
                           - Task 1: Configure the Entity
- Annotate the Entity Class with @VirtualAccessMethods
- Add get and set Methods to the Entity
- Define Virtual Attribute Storage
- Use XML
- Task 2: Design the Schema
- Task 3: Provide Additional Mappings
- Task 4: Externalizing Extensions Using a MetaDataSource
- Configure the persistence.xml File
- Configure EntityManagerFactory and the Metadata Repository
- Refresh the Metadata Repository
 
- Code Examples
 
- 
                           
                           Main Tasks for Creating and Supporting an Extensible JPA Entity
                              
                           
                           
                           
- Making JAXB Beans Extensible
- Additional Resources
 
- 
                     
                     Making JPA Entities Extensible
                        
                     
                     
                     
- 13 Using an External MetaData Source
- 
               
               
                  
                  14
                      Tenant Isolation Using TopLink
               
                  
               
               
               - Introduction to the Solution
- 
                     
                     Using Single-Table Multi-Tenancy
                        
                     
                     
                     - 
                           
                           Main Tasks for Using Single-Table Multi-Tenancy
                              
                           
                           
                           - Task 1: Prerequisites
- Task 2: Enable Single-Table Multi-Tenancy
- Using the @Multitenant Annotation
- Using the <multitenant> Element
- Task 3: Specify Tenant Discriminator Columns
- Use the @TenantDiscriminatorColumn Annotation
- Use the <tenant-discriminator-column> Element
- Map Tenant Discriminator Columns
- Define Persistence Unit and Entity Mappings Defaults
- Configure Context Properties and Caching Scope
- Configure a Shared Entity Manager
- Configure a Non-Shared Entity Manager
- Configure an Entity Manager
- Task 4: Perform Operations and Queries
- Task 5: Use Single-Table Multi-Tenancy in an Inheritance Hierarchy
 
 
- 
                           
                           Main Tasks for Using Single-Table Multi-Tenancy
                              
                           
                           
                           
- 
                     
                     Using Table-Per-Tenant Multi-Tenancy
                        
                     
                     
                     - 
                           
                           Main Tasks for Using Table-Per-Tenant Multi-Tenancy
                              
                           
                           
                           - Task 1: Prerequisites
- Task 2: Enable Table-Per-Tenant Multi-Tenancy
- Using the @Multitenant and @TenantTableDiscriminator Annotations
- Using the <multitenant> Element
- Task 3: Specify Tenant Table Discriminator
- Using the @TenantTableDiscriminator Annotation
- Using the <tenant-table-discriminator> Element
- Task 4: Specify a Context Property at Runtime
- Task 5: Perform Operations and Queries
 
 
- 
                           
                           Main Tasks for Using Table-Per-Tenant Multi-Tenancy
                              
                           
                           
                           
- Using VPD Multi-Tenancy
- Additional Resources
 
- 
               
               
                  
                  15
                      Mapping JPA to XML 
               
                  
               
               
               - Introduction to the Solution
- 
                     
                     Binding JPA Entities to XML
                        
                     
                     
                     - 
                           
                           Binding JPA Relationships to XML
                              
                           
                           
                           - Task 1: Define the Accessor Type and Import Classes
- Task 2: Map Privately-Owned Relationships
- Mapping a One-to-One and Embedded Relationship
- Task 3: Map the Shared Reference Relationship
- Mapping a Many-to-One Shared Reference Relationship
- Mapping a Many-to-Many Shared Reference Relationship
- JPA Entities
 
- Binding Compound Primary Keys to XML
- Binding Embedded ID Classes to XML
- Using the EclipseLink XML Binding Document
 
- 
                           
                           Binding JPA Relationships to XML
                              
                           
                           
                           
- 
                     
                     Mapping Simple Java Values to XML Text Nodes
                        
                     
                     
                     - Mapping a Value to an Attribute
- 
                           
                           Mapping a Value to a Text Node
                              
                           
                           
                           - Mapping a Value to a Simple Text Node
- Mapping by Using JAXB Annotations
- Defining the Mapping in OXM Metadata Format
- Mapping Values to a Text Node in a Simple Sequence
- Mapping by Using JAXB Annotations
- Defining the Mapping in OXM Metadata Format
- Mapping a Value to a Text Node in a Sub-element
- Mapping by Using JAXB Annotations
- Defining the Mapping in OXM Metadata Format
- Mapping Values to a Text Node by Position
- Mapping by Using JAXB Annotations
 
 
- Using XML Metadata Representation to Override JAXB Annotations
- Using XPath Predicates for Mapping
- Using Dynamic JAXB/MOXy
- Additional Resources
 
- 
               
               
                  
                  16
                      Converting Objects to and from JSON Documents
               
                  
               
               
               - Introduction to the Solution
- 
                     
                     Implementing the Solution
                        
                     
                     
                     - Task 1: Marshalling and Unmarshalling JSON Documents
- Task 2: Specifying JSON Bindings
- Task 3: Specifying JSON Data Types
- Task 4: Supporting Attributes
- Task 5: Supporting no Root Element
- Task 5 Using Namespaces
- Task 6: Using Collections
- Task 7: Mapping Root-Level Collections
- Task 8: Wrapping Text Values
 
- Additional Resources
 
- 17 Testing JPA Outside a Container
- 
               
               
                  
                  18
                      Enhancing Performance 
               
                  
               
               
               - Performance Features
- 
                     
                     Monitoring and Optimizing EclipseLink-Enabled Applications
                        
                     
                     
                     - Performance Optimization Recommendations and Tips
- Task 1: Measure EclipseLink Performance with the EclipseLink Profiler
- Task 2: Measure EclipseLink Performance in the Server Environment
- Task 3: Measure Fetch Group Field Usage
- Task 4: Identify Sources of Application Performance Problems
- Task 5: Modify Poorly-Performing Application Components
- Task 6: Measure Performance Again
 
 
- 19 Scaling JPA Applications Using TopLink Grid with Oracle Coherence
- 
               
               
                  
                  20
                      Exposing JPA Entities Through RESTful Data Services
               
                  
               
               
               - Introduction to the Solution
- 
                     
                     Implementing the Solution
                        
                     
                     
                     - Step 1: Prerequisites
- Step 2: Create and Configure the Application
- Step 3: Understand RESTful Data Services URI Basics
- Step 4: Represent Entities Using JPA, JAXB, or JSON
- Step 5: Issue Client Calls for Operations on the Persistence Unit
- Step 6: Implement Security
- Step 7: Understand the Structure of RESTful Data Services Responses
 
- Additional Resources
- RESTful Data Services API Reference
- Entity Operations
- Entity Operations on Relationships
- Query Operations
- Single Result Queries
- Base Operations
- Metadata Operations
 
- 21 Keeping Data Fresh Using TopLink Live Data Queries
- 
               
               
                  
                  22
                      Using Database Events to Invalidate the Cache
               
                  
               
               
               - Introduction to the Solution
- Implementing the Solution
- Limitations on the Solution
- Additional Resources
 
- 23 Using TopLink with NoSQL Databases
- 
               
               
                  
                  24
                      Using Oracle TopLink with the Oracle Database 
               
                  
               
               
               - Introduction to the Solution
- 
                     
                     Implementing the Solution
                        
                     
                     
                     - Using Oracle Platform-Specific APIs
- 
                           
                           Using Oracle PL/SQL With EclipseLink
                              
                           
                           
                           - Executing an Oracle PL/SQL Stored Function
- Main Tasks
- Task 1: Create an Oracle Stored Function That Returns a PL/SQL Record Type
- Task 2: Define an Object Type Mirror
- Task 3: Define a Java Class Mapping The OBJECT Type
- Task 4: Execute a PL/SQL Stored Function Using JpaEntityManager
- Task 5: Define a Stored Function Using @NamedPLSQLStoredFunctionQuery
- Task 6: Use the Stored Function in a Query
- Handling PL/SQL arguments for Oracle Stored Procedures
- Using the PLSQLStoredProcedureCall Class
- Mixing JDBC Arguments With Non JDBC Arguments
- Handling IN and OUT Arguments
- Handling IN OUT Arguments
 
- Using Oracle Virtual Private Database
- Using Oracle Proxy Authentication
- 
                           
                           Using EclipseLink with Oracle RAC
                              
                           
                           
                           - Accessing a RAC-Enabled database from Java EE Applications
- Task 1: Configure a Multi Data Source or GridLink Data Source
- Task 2: Configure the Persistence Unit
- Task 3: Include the Required JARs
- Accessing a RAC-Enabled Database from Standalone Applications
- Task 1: Create a UCP Data Source
- Task 2: Use the UCP Data Source
- Task 3: Include the Required JARs
 
- Using Oracle Spatial and Graph
 
- Additional Resources
 
- 25 Optimizing Persistence Applications for Oracle Exalogic