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.EagerFetchMode
2.6.16. kodo.FetchBatchSize
2.6.17. kodo.FetchGroups
2.6.18. kodo.FilterListeners
2.6.19. kodo.FlushBeforeQueries
2.6.20. kodo.JMXInterface
2.6.21. kodo.LicenseKey
2.6.22. kodo.ReadLockLevel
2.6.23. kodo.LockManager
2.6.24. kodo.LockTimeout
2.6.25. kodo.Log
2.6.26. kodo.ManagedRuntime
2.6.27. kodo.MBeans
2.6.28. kodo.MBeanServerStrategy
2.6.29. kodo.PersistenceManagerImpl
2.6.30. kodo.PersistenceManagerServer
2.6.31. kodo.PersistentClasses
2.6.32. kodo.ProfilingAgent
2.6.33. kodo.ProfilingHelper
2.6.34. kodo.ProfilingInterface
2.6.35. kodo.ProxyManager
2.6.36. kodo.QueryCache
2.6.37. kodo.QueryCompilationCache
2.6.38. kodo.RemoteCommitProvider
2.6.39. kodo.RemoteJMXAdaptor
2.6.40. kodo.RestoreMutableValues
2.6.41. kodo.RetainValuesInOptimistic
2.6.42. kodo.TransactionMode
2.6.43. kodo.jdbc.AutoIncrementConstraints
2.6.44. kodo.jdbc.ClassIndicator
2.6.45. kodo.jdbc.ConnectionDecorators
2.6.46. kodo.jdbc.DataSourceMode
2.6.47. kodo.jdbc.DBDictionary
2.6.48. kodo.jdbc.FetchDirection
2.6.49. kodo.jdbc.ForeignKeyConstraints
2.6.50. kodo.jdbc.JDBCListeners
2.6.51. kodo.jdbc.LRSSize
2.6.52. kodo.jdbc.MappingFactory
2.6.53. kodo.jdbc.ResultSetType
2.6.54. kodo.jdbc.SchemaFactory
2.6.55. kodo.jdbc.Schemas
2.6.56. kodo.jdbc.SequenceFactory
2.6.57. kodo.jdbc.SubclassMapping
2.6.58. kodo.jdbc.SynchronizeMappings
2.6.59. kodo.jdbc.TransactionIsolation
2.6.60. kodo.jdbc.UpdateManager
2.6.61. kodo.jdbc.VersionIndicator
2.6.62. kodo.jdbc.VerticalQueryMode
2.6.63. kodo.WriteLockLevel
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. Primary Key Generation
5.2.3.1. Sequence Factory
5.2.3.2. Auto-Increment
5.3. Mutable Second Class Object Fields
5.3.1. Restoring Mutable Fields
5.3.2. Typing and Ordering
5.3.3. Proxies
5.3.3.1. Smart Proxies
5.3.3.2. Large Result Set Proxies
5.3.3.3. Custom Proxies
5.4. Enhancement
5.5. Auto-Generating Classes from a Schema
5.5.1. Customizing Reverse Mapping
5.6. 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. dependent
6.2.1.3. element-dependent
6.2.1.4. value-dependent
6.2.1.5. key-dependent
6.2.1.6. type
6.2.1.7. element-type
6.2.1.8. value-type
6.2.1.9. key-type
6.2.1.10. lrs
6.2.1.11. 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-indexed
6.2.2.6. jdbc-element-indexed
6.2.2.7. jdbc-value-indexed
6.2.2.8. jdbc-key-indexed
6.2.2.9. jdbc-ref-indexed
6.2.2.10. jdbc-version-ind-indexed
6.2.2.11. jdbc-class-ind-indexed
6.2.2.12. jdbc-delete-action
6.2.2.13. jdbc-element-delete-action
6.2.2.14. jdbc-value-delete-action
6.2.2.15. jdbc-key-delete-action
6.2.2.16. jdbc-ref-delete-action
6.2.2.17. 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-ordered
6.2.3.6. jdbc-container-meta
6.2.3.7. jdbc-null-ind
6.2.3.8. externalizer
6.2.3.9. factory
6.2.3.10. jdbc-class-ind-value
6.2.3.11. Example
6.2.4. Miscellaneous Extensions
6.2.4.1. fetch-group
6.2.4.2. lock-group
6.2.4.3. data-cache
6.2.4.4. data-cache-timeout
6.2.4.5. jdbc-sequence-factory
6.2.4.6. jdbc-sequence-name
6.2.4.7. jdbc-auto-increment
6.2.4.8. 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 Query 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. 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. Collection Mapping
7.9.9. Many-to-Many Mapping
7.9.10. One-to-Many Mapping
7.9.11. PC Collection Mapping
7.9.12. Map Mapping
7.9.13. N-to-Many Map Mapping
7.9.14. Many-to-N Map Mapping
7.9.15. Many-to-Many Map Mapping
7.9.16. PC Map Mapping
7.9.17. N-to-PC Map Mapping
7.9.18. PC-to-N Map Mapping
7.9.19. PC-to-Many Map Mapping
7.9.20. Many-to-PC Map Mapping
7.9.21. Custom Field Mapping
7.9.22. Externalization
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 Events
10.2.2. 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 Query Extensions
10.7.1.2. Developing Custom Query Extensions
10.7.1.3. Configuring JDOQL Extensions
10.8. Query Aggregates and Projections
10.8.1. Query Aggregates
10.8.1.1. Using Query Aggregates
10.8.1.2. Included Query Aggregates
10.8.1.2.1. count
10.8.1.2.2. sum
10.8.1.2.3. min
10.8.1.2.4. max
10.8.1.2.5. avg
10.8.1.3. Developing Custom Query Aggregates
10.8.1.4. Configuring Query Aggregates
10.8.2. Query Projections
10.8.2.1. Using Query Projections
10.8.3. JDOQL Variables in Aggregates and Projections
10.8.4. Custom Query Result Class
10.8.4.1. Using a Bean Query Result Class
10.8.4.2. Using a Generic Query Result Class
10.8.4.3. Using a Result Alias
10.9. Object Locking
10.9.1. Configuring Default Locking
10.9.2. Configuring Lock Levels at Runtime
10.9.3. Object Locking APIs
10.9.4. Lock Manager
10.9.5. Rules for Locking Behavior
10.9.6. Known Issues and Limitations
11. Remote and Offline JDO
11.1. Detach and Attach
11.1.1. Configuring detachability
11.1.2. Detachable behavior
11.1.3. Detach and Attach Callbacks
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. MBeanServer Creation / Finding Strategy
12.1.2. Remote JMX Adaptor
12.1.3. kodo.MBeans Property
12.1.4. Local Management
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 JBoss 3.2
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. Direct SQL Execution
13.4. MethodQL
13.5. Remote PersistenceManagers
13.6. Custom Class Mappings
13.7. 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. Tangosol Integration
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.6. Lock Groups
14.6.1. Lock Group Mapping
14.7. Profiling
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