Kodo JDO Reference Guide

Table of Contents

1. Introduction
1.1. Intended Audience
2. Configuration
2.1. Introduction
2.2. Runtime Configuration
2.3. Command Line Configuration
2.3.1. Code Formatting
2.4. Plugin Configuration
2.5. JDO Standard Properties
2.5.1. javax.jdo.PersistenceManagerFactoryClass
2.5.2. javax.jdo.option.ConnectionDriverName
2.5.3. javax.jdo.option.ConnectionFactoryName
2.5.4. javax.jdo.option.ConnectionFactory2Name
2.5.5. javax.jdo.option.ConnectionPassword
2.5.6. javax.jdo.option.ConnectionURL
2.5.7. javax.jdo.option.ConnectionUserName
2.5.8. javax.jdo.option.IgnoreCache
2.5.9. javax.jdo.option.Multithreaded
2.5.10. javax.jdo.option.NontransactionalRead
2.5.11. javax.jdo.option.NontransactionalWrite
2.5.12. javax.jdo.option.Optimistic
2.5.13. javax.jdo.option.RestoreValues
2.5.14. javax.jdo.option.RetainValues
2.6. Kodo JDO Properties
2.6.1. kodo.AggregateListeners
2.6.2. kodo.ClassResolver
2.6.3. kodo.ConnectionProperties
2.6.4. kodo.ConnectionFactoryProperties
2.6.5. kodo.Connection2DriverName
2.6.6. kodo.Connection2Password
2.6.7. kodo.Connection2URL
2.6.8. kodo.Connection2UserName
2.6.9. kodo.Connection2Properties
2.6.10. kodo.ConnectionFactory2Properties
2.6.11. kodo.ConnectionRetainMode
2.6.12. kodo.CopyObjectIds
2.6.13. kodo.DataCache
2.6.14. kodo.DataCacheTimeout
2.6.15. kodo.DynamicDataStructs
2.6.16. kodo.EagerFetchMode
2.6.17. kodo.FetchBatchSize
2.6.18. kodo.FetchGroups
2.6.19. kodo.FilterListeners
2.6.20. kodo.FlushBeforeQueries
2.6.21. kodo.InverseManager
2.6.22. kodo.LicenseKey
2.6.23. kodo.LockManager
2.6.24. kodo.LockTimeout
2.6.25. kodo.Log
2.6.26. kodo.ManagedRuntime
2.6.27. kodo.ManagementConfiguration
2.6.28. kodo.MetaDataLoader
2.6.29. kodo.ObjectLookupMode
2.6.30. kodo.OrphanedKeyAction
2.6.31. kodo.PersistenceManagerImpl
2.6.32. kodo.PersistenceManagerServer
2.6.33. kodo.PersistentClasses
2.6.34. kodo.ProxyManager
2.6.35. kodo.QueryCache
2.6.36. kodo.QueryCompilationCache
2.6.37. kodo.ReadLockLevel
2.6.38. kodo.RemoteCommitProvider
2.6.39. kodo.RestoreMutableValues
2.6.40. kodo.RetainValuesInOptimistic
2.6.41. kodo.RetryClassRegistration
2.6.42. kodo.SubclassFetchMode
2.6.43. kodo.TransactionMode
2.6.44. kodo.WriteLockLevel
2.6.45. kodo.jdbc.ClassIndicator
2.6.46. kodo.jdbc.ConnectionDecorators
2.6.47. kodo.jdbc.DataSourceMode
2.6.48. kodo.jdbc.DBDictionary
2.6.49. kodo.jdbc.FetchDirection
2.6.50. kodo.jdbc.ForeignKeyConstraints
2.6.51. kodo.jdbc.JDBCListeners
2.6.52. kodo.jdbc.LRSSize
2.6.53. kodo.jdbc.MappingFactory
2.6.54. kodo.jdbc.ResultSetType
2.6.55. kodo.jdbc.SchemaFactory
2.6.56. kodo.jdbc.Schemas
2.6.57. kodo.jdbc.SequenceFactory
2.6.58. kodo.jdbc.SubclassMapping
2.6.59. kodo.jdbc.SynchronizeMappings
2.6.60. kodo.jdbc.TransactionIsolation
2.6.61. kodo.jdbc.UpdateManager
2.6.62. kodo.jdbc.VersionIndicator
3. Logging
3.1. Logging Channels
3.2. Kodo Logging
3.3. Disabling Logging
3.4. Log4J
3.5. Apache Commons Logging
3.5.1. JDK 1.4 java.util.logging
3.6. Custom Log
4. JDBC
4.1. Using the Kodo JDO DataSource
4.2. Using a Third-Party DataSource
4.2.1. Enlisted Data Sources
4.3. Database Support
4.3.1. MySQLDictionary parameters
4.3.2. OracleDictionary parameters
4.4. Configuing the DBDictionary
4.5. Accessing Multiple Databases
4.6. Setting the Transaction Isolation
4.7. Setting the SQL Join Syntax
4.8. Configuring the Use of JDBC Connections
4.9. Runtime Access to JDBC Connections
4.10. Large Result Sets
4.11. SQL Statement Ordering & Foreign Keys
5. Persistent Classes
5.1. Restrictions on Persistent Classes
5.2. Object Identity
5.2.1. Datastore Identity
5.2.2. Application Identity
5.2.3. Single Field Identity
5.2.4. Primary Key Generation
5.2.4.1. Sequence Factory
5.2.4.2. Auto-Increment
5.2.4.3. Sequence-Assigned
5.3. Managed Inverses
5.4. Mutable Second Class Object Fields
5.4.1. Restoring Mutable Fields
5.4.2. Typing and Ordering
5.4.3. Proxies
5.4.3.1. Smart Proxies
5.4.3.2. Large Result Set Proxies
5.4.3.3. Custom Proxies
5.5. Enhancement
5.6. Auto-Generating Classes from a Schema
5.6.1. Customizing Reverse Mapping
5.7. Persistent Class List
6. Metadata
6.1. Generating Default JDO Metadata
6.2. JDO Metadata Extensions
6.2.1. Relation Extensions
6.2.1.1. inverse-owner
6.2.1.2. inverse-logical
6.2.1.3. dependent
6.2.1.4. element-dependent
6.2.1.5. value-dependent
6.2.1.6. key-dependent
6.2.1.7. type
6.2.1.8. element-type
6.2.1.9. value-type
6.2.1.10. key-type
6.2.1.11. lrs
6.2.1.12. Example
6.2.2. Schema Extensions
6.2.2.1. jdbc-size
6.2.2.2. jdbc-element-size
6.2.2.3. jdbc-value-size
6.2.2.4. jdbc-key-size
6.2.2.5. jdbc-type
6.2.2.6. jdbc-sql-type
6.2.2.7. jdbc-indexed
6.2.2.8. jdbc-element-indexed
6.2.2.9. jdbc-value-indexed
6.2.2.10. jdbc-key-indexed
6.2.2.11. jdbc-ref-indexed
6.2.2.12. jdbc-version-ind-indexed
6.2.2.13. jdbc-class-ind-indexed
6.2.2.14. jdbc-delete-action
6.2.2.15. jdbc-element-delete-action
6.2.2.16. jdbc-value-delete-action
6.2.2.17. jdbc-key-delete-action
6.2.2.18. jdbc-ref-delete-action
6.2.2.19. Example
6.2.3. Object-Relational Mapping Extensions
6.2.3.1. jdbc-class-map-name
6.2.3.2. jdbc-version-ind-name
6.2.3.3. jdbc-class-ind-name
6.2.3.4. jdbc-field-map-name
6.2.3.5. jdbc-field-mappings
6.2.3.6. jdbc-ordered
6.2.3.7. jdbc-container-meta
6.2.3.8. jdbc-null-ind
6.2.3.9. externalizer
6.2.3.10. factory
6.2.3.11. external-values
6.2.3.12. jdbc-class-ind-value
6.2.3.13. Example
6.2.4. Miscellaneous Extensions
6.2.4.1. detachable
6.2.4.2. detached-objectid-field
6.2.4.3. detached-state-field
6.2.4.4. fetch-group
6.2.4.5. lock-group
6.2.4.6. lock-groups
6.2.4.7. data-cache
6.2.4.8. data-cache-timeout
6.2.4.9. sequence-assigned
6.2.4.10. subclass-fetch-mode
6.2.4.11. eager-fetch-mode
6.2.4.12. jdbc-sequence-factory
6.2.4.13. jdbc-sequence-name
6.2.4.14. jdbc-auto-increment
6.2.4.15. Example
7. Object-Relational Mapping
7.1. Mapping Tool
7.1.1. Using the Mapping Tool
7.1.2. Generating DDL SQL
7.2. Automatic Runtime Mapping
7.3. Mapping Factory
7.3.1. Importing and Exporting Mapping Data
7.4. Mapping File XML Format
7.5. Mapping Notes
7.5.1. Join Attributes
7.5.2. Non-Standard Joins
7.6. Class Mapping
7.6.1. Base Mapping
7.6.2. Flat Inheritance Mapping
7.6.2.1. Advantages of using Flat Inheritance Mapping
7.6.2.2. Disadvantages of using Flat Inheritance Mapping
7.6.3. Vertical Inheritance Mapping
7.6.3.1. Advantages of using Vertical Inheritance Mapping
7.6.3.2. Disadvantages of using Vertical Inheritance Mapping
7.6.3.3. Vertical Select Modes
7.6.4. Horizontal Inheritance Mapping
7.6.4.1. Special considerations when using Horizontal Inheritance Mapping
7.6.4.2. Advantages of using Horizontal Inheritance Mapping
7.6.4.3. Disadvantages of using Horizontal Inheritance Mapping
7.6.5. Custom Class Mapping
7.7. Version Indicator
7.7.1. Version Number Indicator
7.7.2. Version Date Indicator
7.7.3. State Image Indicator
7.7.4. Custom Version Indicator
7.8. Class Indicator
7.8.1. In-Class-Name Indicator
7.8.2. Metadata Value Indicator
7.8.3. Subclass-Join Indicator
7.8.4. Custom Class Indicator
7.9. Field Mapping
7.9.1. Value Mapping
7.9.2. Blob Mapping
7.9.3. Clob Mapping
7.9.4. Byte Array Mapping
7.9.5. One-to-One Mapping
7.9.6. PC One-to-One Mapping
7.9.7. Embedded One-to-One Mapping
7.9.8. Enumeration Mapping
7.9.9. Collection Mapping
7.9.10. Many-to-Many Mapping
7.9.11. One-to-Many Mapping
7.9.12. PC Collection Mapping
7.9.13. Map Mapping
7.9.14. N-to-Many Map Mapping
7.9.15. Many-to-N Map Mapping
7.9.16. Many-to-Many Map Mapping
7.9.17. PC Map Mapping
7.9.18. N-to-PC Map Mapping
7.9.19. PC-to-N Map Mapping
7.9.20. PC-to-Many Map Mapping
7.9.21. Many-to-PC Map Mapping
7.9.22. Custom Field Mapping
7.9.23. Externalization
7.9.24. External Values
8. Schema Information
8.1. Schema Reflection
8.1.1. Schemas List
8.1.2. Schema Factory
8.1.3. Schema Generator
8.2. Schema Tool
8.3. XML Schema Format
8.4. The SQLLine Utility
9. Runtime Deployment
9.1. JDOHelper
9.2. KodoHelper
9.3. J2EE Deployment
10. JDO Runtime Extensions
10.1. KodoPersistenceManagerFactory
10.2. KodoPersistenceManager
10.2.1. JDO Transaction Events
10.2.2. JDO 2 Preview Methods
10.2.3. Lifecycle Events
10.2.4. PersistenceManager Extension
10.3. KodoExtent
10.4. KodoQuery
10.5. Fetch Configuration
10.6. KodoHelper
10.7. Query Extensions
10.7.1. JDOQL Extensions
10.7.1.1. Included JDOQL Extensions
10.7.1.2. Developing Custom JDOQL Extensions
10.7.1.3. Configuring JDOQL Extensions
10.7.2. Aggregate Extensions
10.7.2.1. Configuring Query Aggregates
10.8. Object Locking
10.8.1. Configuring Default Locking
10.8.2. Configuring Lock Levels at Runtime
10.8.3. Object Locking APIs
10.8.4. Lock Manager
10.8.5. Rules for Locking Behavior
10.8.6. Known Issues and Limitations
10.9. Orphaned Keys
11. Remote and Offline JDO
11.1. Detach and Attach
11.1.1. Declaring Detachability
11.1.2. Detach and Attach Behavior
11.1.3. Defining the Detached Object Graph
11.1.4. Detach and Attach Callbacks
11.1.5. Automatic Detachment
11.1.5.1. Detach on Close
11.1.5.2. Detach on Serialize
11.2. Remote Persistence Managers
11.2.1. Standalone Persistence Manager Server
11.2.2. HTTP Persistence Manager Server
11.2.3. Client Persistence Managers
11.2.4. Data Compression and Filtering
11.2.5. Remote Persistence Manager Deployment
12. Management and Monitoring
12.1. Configuration
12.1.1. Optional Parameters in Management Group
12.1.2. Optional Parameters in Remote Group
12.1.3. Optional Parameters in JSR 160 Group
12.1.4. Optional Parameters in WebLogic 8.1 Group
12.1.5. Configuring Logging for Management / Monitoring
12.2. Kodo Management Console
12.2.1. Remote Connection
12.2.1.1. Connecting to Kodo under WebLogic 8.1
12.2.1.2. Connecting to Kodo under JBoss 3.2
12.2.1.3. Connecting to Kodo under JBoss 4
12.2.2. Using the Kodo Management Console
12.2.2.1. JMX Explorer
12.2.2.1.1. Executing Operations
12.2.2.1.2. Listening to Notifications
12.2.2.2. MBean Panel
12.2.2.2.1. Notifications / Statistics
12.2.2.2.2. Setting Attributes
12.3. Accessing the MBeanServer from Code
12.4. MBeans
12.4.1. Log MBean
12.4.2. Kodo Pooling DataSource MBean
12.4.3. PreparedStatement Cache MBean
12.4.4. Query Cache MBean
12.4.5. Datastore Cache MBean
12.4.6. TimeWatch MBean
12.4.7. Runtime MBean
12.4.8. Profiling MBean
13. Enterprise Edition
13.1. Integrating with the Transaction Manager
13.2. XA Transactions
13.2.1. Requirements for Using Kodo with XA Transactions
13.2.2. Configuring Kodo to Utilize XA Transactions
13.3. JDOQL Subqueries
13.3.1. Subquery Parameters, Variables, and Imports
13.4. Direct SQL Execution
13.5. MethodQL
13.6. Remote PersistenceManagers
13.7. Custom Class Mappings
13.8. Non-relational Database Access
14. Performance Pack
14.1. SQL Batching
14.2. Eager Fetching
14.2.1. Configuring Eager Fetching
14.2.2. Eager Fetching Considerations
14.3. Datastore Cache
14.3.1. Overview of Kodo JDO Datastore Caching
14.3.2. Kodo JDO Cache Usage
14.3.3. Query Caching
14.3.4. DataCache Integrations
14.3.5. Cache Extension
14.3.6. Important Notes
14.3.7. Known Issues and Limitations
14.4. Remote Event Notification Framework
14.4.1. Remote Commit Provider Configuration
14.4.2. Customization
14.5. Fetch Groups
14.5.1. Normal Default Fetch Group Behavior
14.5.2. Kodo JDO Fetch Group Behavior
14.5.3. Custom Fetch Group Configuration
14.5.4. Per-field Fetch Configuration
14.6. Lock Groups
14.6.1. Lock Groups and Subclasses
14.6.2. Lock Group Mapping
14.7. Profiling
14.7.1. Profiling in an embedded GUI
14.7.2. Dumping profiling data to disk from a batch process
14.7.3. Controlling how the profiler obtains context information
15. Third Party Integration
15.1. Overview of Third Party Integration features in Kodo
15.2. Apache Ant
15.2.1. Common Ant Configuration Options
15.2.2. JDO Enhancer Ant Task
15.2.3. Application Identity Tool Ant Task
15.2.4. JDO Metadata Tool Ant Task
15.2.5. Mapping Tool Ant Task
15.2.6. Reverse Mapping Tool Ant Task
15.2.7. Schema Tool Ant Task
15.2.8. Schema Generator Ant Task
15.3. XDoclet
15.4. Borland JBuilder
15.4.1. Installing Kodo Into JBuilder
15.4.2. Kodo Configuration from JBuilder
15.4.3. Creating and building JDO projects in JBuilder
15.4.4. Editing JDO Metadata from JBuilder
15.4.5. Editing Mapping Info from JBuilder
15.4.6. JBuilder Project Sample
15.5. Sun ONE Studio / NetBeans IDE
15.5.1. Before Installing Kodo into the IDE
15.5.2. Installing Kodo into the IDE
15.5.3. Configuring the Kodo Module
15.5.4. Kodo Template Wizards
15.5.5. JDO DataObject
15.5.6. Mapping DataObject
15.5.7. Kodo Integration into the Build Process
15.5.8. SunONE / NetBeans Sample
15.6. Eclipse / WebSphere Studio Integration
15.6.1. Installing the Kodo Eclipse Plugin
15.6.2. Configuring the Plugin
15.6.3. Using Kodo in Eclipse IDEs
15.6.4. Eclipse Sample
16. Optimization Techniques