5.5. Migrating from Kodo 4.0 to Kodo 4.1

Oracle 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 6, 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.