6.5. Migrating from Kodo 4.0 to Kodo 4.1
Prev | Appendix 6. Upgrading Kodo | Next

## 6.5. Migrating from Kodo 4.0 to Kodo 4.1

BEA has donated a large part of Kodo's persistence kernel and JPA bindings to the Apache Software Foundation as the OpenJPA project. The 4.1 release of Kodo now deploys on top of the standard OpenJPA jars, adding extended features and performance enhancements. This deployment style allows you to build a custom OpenJPA jar from source while continuing to use Kodo's commercial features; however, it has many important consequences for users upgrading from Kodo 4.0:

- Kodo's library dependencies have changed. You must include the OpenJPA jar and the various open source jars OpenJPA depends on in your classpath for all development and runtime use of Kodo. See Appendix 7, Development and Runtime Libraries for details.

- Kodo 4.1 uses OpenJPA's JPA bindings. Interfaces such as `kodo.persistence.KodoEntityManagerFactory` and `kodo.persistence.KodoEntityManager` have generally been deprecated in favor of their OpenJPA equivalents. Kodo 4.1 does provide backwards-compatible wrappers, however. Set the `provider` in your `persistence.xml` file to the Kodo 4.0 `kodo.persistence.PersistenceProviderImpl` in place of the `org.apache.openjpa.persistence.PersistenceProviderImpl` to use the backwards-compatible `kodo.persistence.*` wrappers.

- Most of the Kodo-specific annotations for extended JPA metadata and mappings in Kodo 4.0 have moved to OpenJPA. The annotations have the same names, but are in the `org.apache.openjpa.persistence` and `org.apache.openjpa.persistence.jdbc` packages instead of the `kodo.persistence` and `kodo.persistence.jdbc` packages. Change your imports to use the OpenJPA versions. Some annotations remain in the Kodo packages: these annotations represent mappings and metadata constructs that were not donated to OpenJPA, and are only available in the commercial Kodo product.

- The default sequence table names have changed. By default, Kodo 4.0 used a global sequence table called `KODO_SEQUENCE_TABLE`, and/or a per-class sequence tbale called `KODO_SEQUENCES_TABLE`. Kodo 4.1 uses OpenJPA's sequencing, which uses tables called `OPENJPA_SEQUENCE_TABLE` and `OPENJPA_SEQUENCES_TABLE`, respectively. Use the `Table` property of Kodo's sequencing plugins to set the old names. For example:

      kodo.Sequence: Table=KODO_SEQUENCE_TABLE

  Or

      kodo.Sequence: class-table(Table=KODO_SEQUENCES_TABLE)

- Some constants using the `kodo.*` prefix have changed to use `openjpa.*`. Examples include the query language `openjpa.MethodQL` and the Oracle query hint `openjpa.hint.OracleSelectHint`.

- Some advanced settings of the `DBDictionary` are now configurable via the `kodo.jdbc.SQLFactory` property instead. See Section 4.5, “SQLFactory Properties” for details.

- You must recompile and re-enhance all persistent classes used in previous versions of Kodo due to changes in the enhancement scheme.

Finally, Kodo 4.1 also implements the final JDO 2 specification. Some JDO APIs and behaviors may have changed slightly from darft specification versions.

Prev | Up | Next
6.4. Migrating from Kodo 3.x to Kodo 4.0 | Home | 6.6. Migrating from Kodo 4.x.x to Kodo 4.1.3+