This fixes OPENJPA-2795 in that generation of indizes for @ManyToOne relations that are also foreign keys can optionally be turned on if so desired. Default behaviour of OpenJPA is unchanged.

This commit contains two new features:
1) A new DB-specific flag DBDictionary#indexPhysicalForeignKeys so that indices for foreign keys will be generated for
database systems that don't automatically create an index for foreign keys.
2) A new boolean property MappingDefaults.IndexPhysicalForeignKeys that will turn the feature from 1) on or off.
By default MappingDefaults.IndexPhysicalForeignKeys is false so that the feature from 1) is disabled.

Note: DBDictionary#indexPhysicalForeignKeys works similar to the pre-existing flag DBDictionary#indexLogicalForeignKeys.

Note: this commit enables FK indices for Oracle and MS SQLServer. Other database systems may benefit, too, and should also be changed.
4 files changed