in openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java [122:365]
public JDBCConfigurationImpl(boolean derivations, boolean loadGlobals) {
super(false, false);
String[] aliases;
schema = addString("jdbc.Schema");
schemas = addStringList("jdbc.Schemas");
transactionIsolation = addInt("jdbc.TransactionIsolation");
aliases = new String[]{
"default", String.valueOf(-1),
"none", String.valueOf(Connection.TRANSACTION_NONE),
"read-committed", String.valueOf
(Connection.TRANSACTION_READ_COMMITTED),
"read-uncommitted", String.valueOf
(Connection.TRANSACTION_READ_UNCOMMITTED),
"repeatable-read", String.valueOf
(Connection.TRANSACTION_REPEATABLE_READ),
"serializable", String.valueOf(Connection.TRANSACTION_SERIALIZABLE)
};
transactionIsolation.setAliases(aliases);
transactionIsolation.setDefault(aliases[0]);
transactionIsolation.set(-1);
transactionIsolation.setAliasListComprehensive(true);
resultSetType = addInt("jdbc.ResultSetType");
aliases = new String[]{
"forward-only", String.valueOf(ResultSet.TYPE_FORWARD_ONLY),
"scroll-sensitive", String.valueOf
(ResultSet.TYPE_SCROLL_SENSITIVE),
"scroll-insensitive", String.valueOf
(ResultSet.TYPE_SCROLL_INSENSITIVE),
};
resultSetType.setAliases(aliases);
resultSetType.setDefault(aliases[0]);
resultSetType.set(ResultSet.TYPE_FORWARD_ONLY);
resultSetType.setAliasListComprehensive(true);
fetchDirection = addInt("jdbc.FetchDirection");
aliases = new String[]{
"forward", String.valueOf(ResultSet.FETCH_FORWARD),
"reverse", String.valueOf(ResultSet.FETCH_REVERSE),
"unknown", String.valueOf(ResultSet.FETCH_UNKNOWN),
};
fetchDirection.setAliases(aliases);
fetchDirection.setDefault(aliases[0]);
fetchDirection.set(ResultSet.FETCH_FORWARD);
fetchDirection.setAliasListComprehensive(true);
eagerFetchMode = new FetchModeValue("jdbc.EagerFetchMode");
eagerFetchMode.setDefault(FetchModeValue.EAGER_PARALLEL);
eagerFetchMode.set(EagerFetchModes.EAGER_PARALLEL);
addValue(eagerFetchMode);
subclassFetchMode = new FetchModeValue("jdbc.SubclassFetchMode");
subclassFetchMode.setDefault(FetchModeValue.EAGER_JOIN);
subclassFetchMode.set(EagerFetchModes.EAGER_JOIN);
addValue(subclassFetchMode);
lrsSize = addInt("jdbc.LRSSize");
aliases = new String[]{
"query", String.valueOf(LRSSizes.SIZE_QUERY),
"unknown", String.valueOf(LRSSizes.SIZE_UNKNOWN),
"last", String.valueOf(LRSSizes.SIZE_LAST),
};
lrsSize.setAliases(aliases);
lrsSize.setDefault(aliases[0]);
lrsSize.set(LRSSizes.SIZE_QUERY);
lrsSize.setAliasListComprehensive(true);
synchronizeMappings = addString("jdbc.SynchronizeMappings");
aliases = new String[]{ "false", null };
synchronizeMappings.setAliases(aliases);
synchronizeMappings.setDefault(aliases[0]);
jdbcListenerPlugins = addPluginList("jdbc.JDBCListeners");
jdbcListenerPlugins.setInstantiatingGetter("getJDBCListenerInstances");
connectionDecoratorPlugins = addPluginList
("jdbc.ConnectionDecorators");
connectionDecoratorPlugins.setInstantiatingGetter
("getConnectionDecoratorInstances");
dbdictionaryPlugin = addPlugin("jdbc.DBDictionary", true);
aliases = new String[]{
"access", org.apache.openjpa.jdbc.sql.AccessDictionary.class.getName(),
"db2", org.apache.openjpa.jdbc.sql.DB2Dictionary.class.getName(),
"derby", org.apache.openjpa.jdbc.sql.DerbyDictionary.class.getName(),
"empress", org.apache.openjpa.jdbc.sql.EmpressDictionary.class.getName(),
"foxpro", org.apache.openjpa.jdbc.sql.FoxProDictionary.class.getName(),
"h2", org.apache.openjpa.jdbc.sql.H2Dictionary.class.getName(),
"hsql", org.apache.openjpa.jdbc.sql.HSQLDictionary.class.getName(),
"informix", org.apache.openjpa.jdbc.sql.InformixDictionary.class.getName(),
"ingres", org.apache.openjpa.jdbc.sql.IngresDictionary.class.getName(),
"jdatastore", org.apache.openjpa.jdbc.sql.JDataStoreDictionary.class.getName(),
"mariadb", org.apache.openjpa.jdbc.sql.MariaDBDictionary.class.getName(),
"mysql", org.apache.openjpa.jdbc.sql.MySQLDictionary.class.getName(),
"herddb", org.apache.openjpa.jdbc.sql.HerdDBDictionary.class.getName(),
"oracle", org.apache.openjpa.jdbc.sql.OracleDictionary.class.getName(),
"pointbase", org.apache.openjpa.jdbc.sql.PointbaseDictionary.class.getName(),
"postgres", org.apache.openjpa.jdbc.sql.PostgresDictionary.class.getName(),
"soliddb", org.apache.openjpa.jdbc.sql.SolidDBDictionary.class.getName(),
"sqlserver", org.apache.openjpa.jdbc.sql.SQLServerDictionary.class.getName(),
"sybase", org.apache.openjpa.jdbc.sql.SybaseDictionary.class.getName(),
"maxdb", MaxDBDictionary.class.getName(),
};
dbdictionaryPlugin.setAliases(aliases);
dbdictionaryPlugin.setInstantiatingGetter("getDBDictionaryInstance");
updateManagerPlugin = addPlugin("jdbc.UpdateManager", true);
aliases = new String[]{
"default",
BatchingConstraintUpdateManager.class.getName(),
"operation-order",
"org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager",
"constraint",
"org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager",
"batching-constraint",
BatchingConstraintUpdateManager.class.getName(),
"batching-operation-order",
BatchingOperationOrderUpdateManager.class.getName(),
};
updateManagerPlugin.setAliases(aliases);
updateManagerPlugin.setDefault(aliases[0]);
updateManagerPlugin.setString(aliases[0]);
updateManagerPlugin.setInstantiatingGetter("getUpdateManagerInstance");
driverDataSourcePlugin = addPlugin("jdbc.DriverDataSource", false);
aliases = new String[]{
"auto", "org.apache.openjpa.jdbc.schema.AutoDriverDataSource",
"simple", "org.apache.openjpa.jdbc.schema.SimpleDriverDataSource",
"dbcp", "org.apache.openjpa.jdbc.schema.DBCPDriverDataSource"
};
driverDataSourcePlugin.setAliases(aliases);
driverDataSourcePlugin.setDefault(aliases[0]);
driverDataSourcePlugin.setString(aliases[0]);
schemaFactoryPlugin = addPlugin("jdbc.SchemaFactory", true);
aliases = new String[]{
"dynamic", "org.apache.openjpa.jdbc.schema.DynamicSchemaFactory",
"native", "org.apache.openjpa.jdbc.schema.LazySchemaFactory",
"file", "org.apache.openjpa.jdbc.schema.FileSchemaFactory",
"table", "org.apache.openjpa.jdbc.schema.TableSchemaFactory",
// deprecated alias
"db", "org.apache.openjpa.jdbc.schema.TableSchemaFactory",
};
schemaFactoryPlugin.setAliases(aliases);
schemaFactoryPlugin.setDefault(aliases[0]);
schemaFactoryPlugin.setString(aliases[0]);
schemaFactoryPlugin.setInstantiatingGetter("getSchemaFactoryInstance");
sqlFactoryPlugin = addPlugin("jdbc.SQLFactory", true);
aliases = new String[]{
"default", "org.apache.openjpa.jdbc.sql.SQLFactoryImpl",
};
sqlFactoryPlugin.setAliases(aliases);
sqlFactoryPlugin.setDefault(aliases[0]);
sqlFactoryPlugin.setString(aliases[0]);
sqlFactoryPlugin.setInstantiatingGetter("getSQLFactoryInstance");
mappingFactoryPlugin = new MappingFactoryValue("jdbc.MappingFactory");
addValue(mappingFactoryPlugin);
mappingDefaultsPlugin = addPlugin("jdbc.MappingDefaults", true);
aliases = new String[]{
"default", "org.apache.openjpa.jdbc.meta.MappingDefaultsImpl",
};
mappingDefaultsPlugin.setAliases(aliases);
mappingDefaultsPlugin.setDefault(aliases[0]);
mappingDefaultsPlugin.setString(aliases[0]);
mappingDefaultsPlugin.setInstantiatingGetter
("getMappingDefaultsInstance");
// set up broker factory defaults
brokerFactoryPlugin.setAlias("jdbc", JDBCBrokerFactory.class.getName());
brokerFactoryPlugin.setDefault("jdbc");
brokerFactoryPlugin.setString("jdbc");
// set new default for mapping repos
metaRepositoryPlugin.setAlias("default",
"org.apache.openjpa.jdbc.meta.MappingRepository");
metaRepositoryPlugin.setDefault("default");
metaRepositoryPlugin.setString("default");
// set new default for lock manager
lockManagerPlugin.setAlias("pessimistic",
PessimisticLockManager.class.getName());
lockManagerPlugin.setDefault("pessimistic");
lockManagerPlugin.setString("pessimistic");
// native savepoint manager options
savepointManagerPlugin.setAlias("jdbc",
"org.apache.openjpa.jdbc.kernel.JDBC3SavepointManager");
// set new aliases and defaults for sequence
seqPlugin.setAliases(JDBCSeqValue.ALIASES);
seqPlugin.setDefault(JDBCSeqValue.ALIASES[0]);
seqPlugin.setString(JDBCSeqValue.ALIASES[0]);
// This plug-in is declared in superclass but defined here
// because PreparedQueryCache is currently available for JDBC
// backend only
preparedQueryCachePlugin = addPlugin("jdbc.QuerySQLCache", true);
aliases = new String[] {
"true", "org.apache.openjpa.jdbc.kernel.PreparedQueryCacheImpl",
"false", null
};
preparedQueryCachePlugin.setAliases(aliases);
preparedQueryCachePlugin.setAliasListComprehensive(true);
preparedQueryCachePlugin.setDefault(aliases[0]);
preparedQueryCachePlugin.setClassName(aliases[1]);
preparedQueryCachePlugin.setDynamic(true);
preparedQueryCachePlugin.setInstantiatingGetter(
"getQuerySQLCacheInstance");
finderCachePlugin = addPlugin("jdbc.FinderCache", true);
aliases = new String[] {
"true", "org.apache.openjpa.jdbc.kernel.FinderCacheImpl",
"false", null
};
finderCachePlugin.setAliases(aliases);
finderCachePlugin.setAliasListComprehensive(true);
finderCachePlugin.setDefault(aliases[0]);
finderCachePlugin.setClassName(aliases[1]);
finderCachePlugin.setDynamic(true);
finderCachePlugin.setInstantiatingGetter("getFinderCacheInstance");
identifierUtilPlugin = addPlugin("jdbc.IdentifierUtil", true);
aliases = new String[] {
"default", "org.apache.openjpa.jdbc.identifier.DBIdentifierUtilImpl" };
identifierUtilPlugin.setAliases(aliases);
identifierUtilPlugin.setDefault(aliases[0]);
identifierUtilPlugin.setString(aliases[0]);
identifierUtilPlugin.setInstantiatingGetter("getIdentifierUtilInstance");
supportedOptions().add(OPTION_QUERY_SQL);
supportedOptions().add(OPTION_JDBC_CONNECTION);
supportedOptions().remove(OPTION_VALUE_INCREMENT);
supportedOptions().remove(OPTION_NULL_CONTAINER);
if (derivations)
ProductDerivations.beforeConfigurationLoad(this);
if (loadGlobals)
loadGlobals();
}