org.apache.openjpa.jdbc.conf
Interface JDBCConfiguration

All Superinterfaces:
BeanInfo, Cloneable, Closeable, Configuration, OpenJPAConfiguration, Serializable
All Known Implementing Classes:
JDBCConfigurationImpl

public interface JDBCConfiguration
extends OpenJPAConfiguration

Configuration that defines the properties necessary to configure runtime and connect to a JDBC DataSource.

Author:
Marc Prud'hommeaux

Field Summary
static String LOG_JDBC
          Name of the logger for JDBC-related messages: openjpa.jdbc.JDBC.
static String LOG_SCHEMA
          Name of the logger for schema-related messages: openjpa.jdbc.Schema.
static String LOG_SQL
          Name of the logger for SQL execution messages: openjpa.jdbc.SQL.
 
Fields inherited from interface org.apache.openjpa.conf.OpenJPAConfiguration
LOG_DATACACHE, LOG_ENHANCE, LOG_METADATA, LOG_QUERY, LOG_RUNTIME, LOG_TOOL, OPTION_DATASTORE_CONNECTION, OPTION_EMBEDDED_COLLECTION_RELATION, OPTION_EMBEDDED_MAP_RELATION, OPTION_EMBEDDED_RELATION, OPTION_ID_APPLICATION, OPTION_ID_DATASTORE, OPTION_INC_FLUSH, OPTION_JDBC_CONNECTION, OPTION_NONTRANS_READ, OPTION_NULL_CONTAINER, OPTION_OPTIMISTIC, OPTION_QUERY_SQL, OPTION_TYPE_ARRAY, OPTION_TYPE_COLLECTION, OPTION_TYPE_MAP, OPTION_VALUE_AUTOASSIGN, OPTION_VALUE_INCREMENT
 
Fields inherited from interface org.apache.openjpa.lib.conf.Configuration
ATTRIBUTE_ALLOWED_VALUES, ATTRIBUTE_CATEGORY, ATTRIBUTE_INTERFACE, ATTRIBUTE_ORDER, ATTRIBUTE_TYPE, ATTRIBUTE_XML
 
Fields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
 
Method Summary
 ConnectionDecorator[] getConnectionDecoratorInstances()
          The ConnectionDecorators to use.
 String getConnectionDecorators()
          A comma-separated list of the ConnectionDecorator for adding functionality to JDBC connections.
 DataSource getDataSource(StoreContext ctx)
          Return the primary data source to use.
 DataSource getDataSource2(StoreContext ctx)
          Return the non-enlisted data source to use.
 String getDBDictionary()
          The DBDictionary to use to define the RDBMS SQL information.
 DBDictionary getDBDictionaryInstance()
          The DBDictionary to use.
 String getDriverDataSource()
          The DriverDataSource to use for creating a DataSource from a JDBC Driver.
 String getEagerFetchMode()
          Specifies the default eager fetch mode to use.
 int getEagerFetchModeConstant()
          Return the eager fetch mode as one of the following symbolic constants: EagerFetchModes.EAGER_NONE EagerFetchModes.EAGER_JOIN EagerFetchModes.EAGER_PARALLEL
 String getFetchDirection()
          The JDBC fetch direction.
 int getFetchDirectionConstant()
          Return the result set constant for the fetch direction.
 JDBCListener[] getJDBCListenerInstances()
          The JDBCListeners to use.
 String getJDBCListeners()
          A comma-separated list of the JDBCListener plugins for listening to JDBCEvents.
 String getLRSSize()
          How to obtain the size of large result sets.
 int getLRSSizeConstant()
          Return the LRSSizes constant for the large result set size setting.
 String getMappingDefaults()
          A plugin string describing the MappingDefaults to use.
 MappingDefaults getMappingDefaultsInstance()
          The MappingDefaults to use with a repository.
 String getMappingFactory()
          A plugin string describing the MetaDataFactory to use for loading and storing object-relational mapping data.
 MappingRepository getMappingRepositoryInstance()
          Return the mapping repository.
 String getResultSetType()
          The JDBC result set type.
 int getResultSetTypeConstant()
          Return the result set constant for the result set type.
 String getSchema()
          Default schema for unqualified tables.
 String getSchemaFactory()
          The plugin string for the SchemaFactory to use to provide schema information during system initialization.
 SchemaFactory getSchemaFactoryInstance()
          The SchemaFactory to use for schema information.
 String getSchemas()
          Comma-separated list of modifiable schemas for persistent instances.
 String[] getSchemasList()
          Modificable schema components.
 String getSQLFactory()
          The SQL factory to use for SQL constructs.
 SQLFactory getSQLFactoryInstance()
          The SQL factory to use for SQL constructs.
 String getSubclassFetchMode()
          Specifies the default subclass fetch mode to use.
 int getSubclassFetchModeConstant()
          Return the subclass fetch mode as one of the following symbolic constants: EagerFetchModes.EAGER_NONE EagerFetchModes.EAGER_JOIN EagerFetchModes.EAGER_PARALLEL
 String getSynchronizeMappings()
          Whether OpenJPA should try to automatically refresh O/R mapping information and the database schema.
 String getTransactionIsolation()
          The transaction isolation level to use at the database level.
 int getTransactionIsolationConstant()
          Return the proper transaction isolation level constant from Connection, or -1 for the default level.
 String getUpdateManager()
          The UpdateManager to use for managing SQL updates.
 UpdateManager getUpdateManagerInstance()
          The UpdateManager for runtime data store interaction.
 DriverDataSource newDriverDataSourceInstance()
          Create an instance of the DriverDataSource to use for creating a DataSource from a JDBC Driver.
 MappingRepository newMappingRepositoryInstance()
          Return a new empty mapping repository of the configured type.
 void setConnectionDecorators(ConnectionDecorator[] decorators)
          The ConnectionDecorators to use.
 void setConnectionDecorators(String decorators)
          A comma-separated list of the ConnectionDecorator for adding functionality to JDBC connections.
 void setDBDictionary(DBDictionary dbdictionary)
          The DBDictionary to use.
 void setDBDictionary(String dbdictionary)
          The DBDictionary to use to define the RDBMS SQL information.
 void setDriverDataSource(String driverDataSource)
          The DriverDataSource to use for creating a DataSource from a JDBC Driver.
 void setEagerFetchMode(int eagerFetchMode)
          Set the eager fetch mode as one of the following symbolic constants: EagerFetchModes.EAGER_NONE EagerFetchModes.EAGER_JOIN EagerFetchModes.EAGER_PARALLEL
 void setEagerFetchMode(String mode)
          Specifies the default eager fetch mode to use.
 void setFetchDirection(int direction)
          Set the result set fetch direction constant.
 void setFetchDirection(String direction)
          The JDBC fetch direction.
 void setJDBCListeners(JDBCListener[] jdbcListeners)
          The JDBCListeners to use.
 void setJDBCListeners(String jdbcListeners)
          A comma-separated list of the JDBCListener plugins for listening to JDBCEvents.
 void setLRSSize(int size)
          Set the fetch configuration large result set size constant.
 void setLRSSize(String lrsSize)
          How to obtain the size of large result sets.
 void setMappingDefaults(MappingDefaults map)
          The MappingDefaults to use with a repository.
 void setMappingDefaults(String map)
          A plugin string describing the MappingDefaults to use.
 void setMappingFactory(String mappingFactory)
          A plugin string describing the MetaDataFactory to use for loading and storing object-relational mapping data.
 void setResultSetType(int type)
          Set the result set constant type.
 void setResultSetType(String type)
          The JDBC result set type.
 void setSchema(String schema)
          Default schema for unqualified tables.
 void setSchemaFactory(SchemaFactory schemaFactory)
          The SchemaFactory to use for schema information.
 void setSchemaFactory(String schemaFactory)
          The plugin string for the SchemaFactory to use to provide schema information during system initialization.
 void setSchemas(String schemas)
          Comma-separated list of modifiable schemas for persistent instances.
 void setSchemas(String[] schemas)
          Modifiable schema components.
 void setSQLFactory(SQLFactory sqlFactory)
          The SQL factory to use for SQL constructs.
 void setSQLFactory(String sqlFactory)
          The SQL factory to use for SQL constructs.
 void setSubclassFetchMode(int subclassFetchMode)
          Set the subclass fetch mode as one of the following symbolic constants: EagerFetchModes.EAGER_NONE EagerFetchModes.EAGER_JOIN EagerFetchModes.EAGER_PARALLEL
 void setSubclassFetchMode(String mode)
          Specifies the default subclass fetch mode to use.
 void setSynchronizeMappings(String synchronizeMappings)
          Whether OpenJPA should try to automatically refresh O/R mapping information and the database schema.
 void setTransactionIsolation(int level)
          Set the proper transaction isolation level constant from Connection, or -1 for the default level.
 void setTransactionIsolation(String level)
          The transaction isolation level to use at the database level.
 void setUpdateManager(String updateManager)
          The UpdateManager to use for managing SQL updates.
 void setUpdateManager(UpdateManager updateManager)
          The UpdateManager for runtime data store interaction.
 
Methods inherited from interface org.apache.openjpa.conf.OpenJPAConfiguration
getAggregateListenerInstances, getAggregateListeners, getAutoClear, getAutoClearConstant, getAutoDetach, getAutoDetachConstant, getBrokerFactory, getBrokerImpl, getClassResolver, getClassResolverInstance, getCompatibility, getCompatibilityInstance, getConnection2DriverName, getConnection2Password, getConnection2Properties, getConnection2URL, getConnection2UserName, getConnectionDriverName, getConnectionFactory, getConnectionFactory2, getConnectionFactory2Name, getConnectionFactory2Properties, getConnectionFactoryMode, getConnectionFactoryName, getConnectionFactoryProperties, getConnectionPassword, getConnectionProperties, getConnectionRetainMode, getConnectionRetainModeConstant, getConnectionURL, getConnectionUserName, getDataCache, getDataCacheManager, getDataCacheManagerInstance, getDataCacheTimeout, getDetachStateInstance, getDynamicDataStructs, getFetchBatchSize, getFetchGroups, getFetchGroupsList, getFilterListenerInstances, getFilterListeners, getFlushBeforeQueries, getFlushBeforeQueriesConstant, getIgnoreChanges, getInverseManager, getLockManager, getLockTimeout, getManagedRuntime, getManagedRuntimeInstance, getMapping, getMaxFetchDepth, getMetaDataFactory, getMetaDataRepository, getMetaDataRepositoryInstance, getMultithreaded, getNontransactionalRead, getNontransactionalWrite, getOptimistic, getOrphanedKeyAction, getOrphanedKeyActionInstance, getProxyManager, getProxyManagerInstance, getQueryCache, getReadLockLevel, getReadLockLevelConstant, getRemoteCommitEventManager, getRemoteCommitProvider, getRestoreState, getRestoreStateConstant, getRetainState, getRetryClassRegistration, getSavepointManager, getSavepointManagerInstance, getSequence, getSequenceInstance, getSpecification, getStoreFacadeTypeRegistry, getTransactionMode, getWriteLockLevel, getWriteLockLevelConstant, isConnectionFactoryModeManaged, isTransactionModeManaged, newBrokerInstance, newInverseManagerInstance, newLockManagerInstance, newMetaDataFactoryInstance, newMetaDataRepositoryInstance, newRemoteCommitProviderInstance, setAggregateListeners, setAggregateListeners, setAutoClear, setAutoClear, setAutoDetach, setAutoDetach, setBrokerFactory, setBrokerImpl, setClassResolver, setClassResolver, setCompatibility, setConnection2DriverName, setConnection2Password, setConnection2Properties, setConnection2URL, setConnection2UserName, setConnectionDriverName, setConnectionFactory, setConnectionFactory2, setConnectionFactory2Name, setConnectionFactory2Properties, setConnectionFactoryMode, setConnectionFactoryModeManaged, setConnectionFactoryName, setConnectionFactoryProperties, setConnectionPassword, setConnectionProperties, setConnectionRetainMode, setConnectionRetainMode, setConnectionURL, setConnectionUserName, setDataCache, setDataCacheManager, setDataCacheManager, setDataCacheTimeout, setDataCacheTimeout, setDetachState, setDetachState, setDynamicDataStructs, setDynamicDataStructs, setFetchBatchSize, setFetchBatchSize, setFetchGroups, setFetchGroups, setFilterListeners, setFilterListeners, setFlushBeforeQueries, setFlushBeforeQueries, setIgnoreChanges, setIgnoreChanges, setInverseManager, setLockManager, setLockTimeout, setLockTimeout, setManagedRuntime, setManagedRuntime, setMapping, setMaxFetchDepth, setMaxFetchDepth, setMetaDataFactory, setMetaDataRepository, setMetaDataRepository, setMultithreaded, setMultithreaded, setNontransactionalRead, setNontransactionalRead, setNontransactionalWrite, setNontransactionalWrite, setOptimistic, setOptimistic, setOrphanedKeyAction, setOrphanedKeyAction, setProxyManager, setProxyManager, setQueryCache, setReadLockLevel, setReadLockLevel, setRemoteCommitEventManager, setRemoteCommitProvider, setRestoreState, setRestoreState, setRetainState, setRetainState, setRetryClassRegistration, setRetryClassRegistration, setSavepointManager, setSequence, setSequence, setSpecification, setTransactionMode, setTransactionModeManaged, setWriteLockLevel, setWriteLockLevel, supportedOptions
 
Methods inherited from interface org.apache.openjpa.lib.conf.Configuration
addPropertyChangeListener, addValue, clone, close, fromProperties, getConfigurationLog, getLog, getLog, getLogFactory, getProductName, getValue, getValues, instantiateAll, isReadOnly, removePropertyChangeListener, removeValue, setLog, setLogFactory, setProductName, setReadOnly, toProperties
 
Methods inherited from interface java.beans.BeanInfo
getAdditionalBeanInfo, getBeanDescriptor, getDefaultEventIndex, getDefaultPropertyIndex, getEventSetDescriptors, getIcon, getMethodDescriptors, getPropertyDescriptors
 

Field Detail

LOG_SQL

static final String LOG_SQL
Name of the logger for SQL execution messages: openjpa.jdbc.SQL.

See Also:
Constant Field Values

LOG_JDBC

static final String LOG_JDBC
Name of the logger for JDBC-related messages: openjpa.jdbc.JDBC.

See Also:
Constant Field Values

LOG_SCHEMA

static final String LOG_SCHEMA
Name of the logger for schema-related messages: openjpa.jdbc.Schema.

See Also:
Constant Field Values
Method Detail

getSchema

String getSchema()
Default schema for unqualified tables.


setSchema

void setSchema(String schema)
Default schema for unqualified tables.


getSchemas

String getSchemas()
Comma-separated list of modifiable schemas for persistent instances.


setSchemas

void setSchemas(String schemas)
Comma-separated list of modifiable schemas for persistent instances.


getSchemasList

String[] getSchemasList()
Modificable schema components.


setSchemas

void setSchemas(String[] schemas)
Modifiable schema components.


getTransactionIsolation

String getTransactionIsolation()
The transaction isolation level to use at the database level. Possible values are:


setTransactionIsolation

void setTransactionIsolation(String level)
The transaction isolation level to use at the database level. Possible values are:


getTransactionIsolationConstant

int getTransactionIsolationConstant()
Return the proper transaction isolation level constant from Connection, or -1 for the default level.


setTransactionIsolation

void setTransactionIsolation(int level)
Set the proper transaction isolation level constant from Connection, or -1 for the default level.


getResultSetType

String getResultSetType()
The JDBC result set type. Defaults to forward-only.


getResultSetTypeConstant

int getResultSetTypeConstant()
Return the result set constant for the result set type.


setResultSetType

void setResultSetType(String type)
The JDBC result set type. Defaults to forward-only.


setResultSetType

void setResultSetType(int type)
Set the result set constant type.


getFetchDirection

String getFetchDirection()
The JDBC fetch direction. Defaults to forward.


getFetchDirectionConstant

int getFetchDirectionConstant()
Return the result set constant for the fetch direction.


setFetchDirection

void setFetchDirection(String direction)
The JDBC fetch direction. Defaults to forward.


setFetchDirection

void setFetchDirection(int direction)
Set the result set fetch direction constant.


getEagerFetchMode

String getEagerFetchMode()
Specifies the default eager fetch mode to use. Defaults to parallel unless the query is by-oid. Possible values are:

Since:
0.3.0

setEagerFetchMode

void setEagerFetchMode(String mode)
Specifies the default eager fetch mode to use. Defaults to parallel unless the query is by-oid. Possible values are:


getEagerFetchModeConstant

int getEagerFetchModeConstant()
Return the eager fetch mode as one of the following symbolic constants:

Since:
0.3.0

setEagerFetchMode

void setEagerFetchMode(int eagerFetchMode)
Set the eager fetch mode as one of the following symbolic constants:

Since:
0.3.0

getSubclassFetchMode

String getSubclassFetchMode()
Specifies the default subclass fetch mode to use. Defaults to join unless the query is by-oid. Possible values are:

Since:
0.3.2

setSubclassFetchMode

void setSubclassFetchMode(String mode)
Specifies the default subclass fetch mode to use. Defaults to join unless the query is by-oid. Possible values are:

Since:
0.3.2

getSubclassFetchModeConstant

int getSubclassFetchModeConstant()
Return the subclass fetch mode as one of the following symbolic constants:

Since:
0.3.2

setSubclassFetchMode

void setSubclassFetchMode(int subclassFetchMode)
Set the subclass fetch mode as one of the following symbolic constants:

Since:
0.3.2

getLRSSize

String getLRSSize()
How to obtain the size of large result sets. Defaults to unknown.


getLRSSizeConstant

int getLRSSizeConstant()
Return the LRSSizes constant for the large result set size setting.


setLRSSize

void setLRSSize(String lrsSize)
How to obtain the size of large result sets. Defaults to unknown.


setLRSSize

void setLRSSize(int size)
Set the fetch configuration large result set size constant.


getSynchronizeMappings

String getSynchronizeMappings()
Whether OpenJPA should try to automatically refresh O/R mapping information and the database schema.


setSynchronizeMappings

void setSynchronizeMappings(String synchronizeMappings)
Whether OpenJPA should try to automatically refresh O/R mapping information and the database schema.


getJDBCListeners

String getJDBCListeners()
A comma-separated list of the JDBCListener plugins for listening to JDBCEvents.


setJDBCListeners

void setJDBCListeners(String jdbcListeners)
A comma-separated list of the JDBCListener plugins for listening to JDBCEvents.


getJDBCListenerInstances

JDBCListener[] getJDBCListenerInstances()
The JDBCListeners to use.


setJDBCListeners

void setJDBCListeners(JDBCListener[] jdbcListeners)
The JDBCListeners to use.


getConnectionDecorators

String getConnectionDecorators()
A comma-separated list of the ConnectionDecorator for adding functionality to JDBC connections.


setConnectionDecorators

void setConnectionDecorators(String decorators)
A comma-separated list of the ConnectionDecorator for adding functionality to JDBC connections.


getConnectionDecoratorInstances

ConnectionDecorator[] getConnectionDecoratorInstances()
The ConnectionDecorators to use.


setConnectionDecorators

void setConnectionDecorators(ConnectionDecorator[] decorators)
The ConnectionDecorators to use.


getDBDictionary

String getDBDictionary()
The DBDictionary to use to define the RDBMS SQL information.


setDBDictionary

void setDBDictionary(String dbdictionary)
The DBDictionary to use to define the RDBMS SQL information.


getDBDictionaryInstance

DBDictionary getDBDictionaryInstance()
The DBDictionary to use.


setDBDictionary

void setDBDictionary(DBDictionary dbdictionary)
The DBDictionary to use.


getUpdateManager

String getUpdateManager()
The UpdateManager to use for managing SQL updates.


setUpdateManager

void setUpdateManager(String updateManager)
The UpdateManager to use for managing SQL updates.


getUpdateManagerInstance

UpdateManager getUpdateManagerInstance()
The UpdateManager for runtime data store interaction.


setUpdateManager

void setUpdateManager(UpdateManager updateManager)
The UpdateManager for runtime data store interaction.


getDriverDataSource

String getDriverDataSource()
The DriverDataSource to use for creating a DataSource from a JDBC Driver.


setDriverDataSource

void setDriverDataSource(String driverDataSource)
The DriverDataSource to use for creating a DataSource from a JDBC Driver.


newDriverDataSourceInstance

DriverDataSource newDriverDataSourceInstance()
Create an instance of the DriverDataSource to use for creating a DataSource from a JDBC Driver.


getSchemaFactory

String getSchemaFactory()
The plugin string for the SchemaFactory to use to provide schema information during system initialization.


setSchemaFactory

void setSchemaFactory(String schemaFactory)
The plugin string for the SchemaFactory to use to provide schema information during system initialization.


getSchemaFactoryInstance

SchemaFactory getSchemaFactoryInstance()
The SchemaFactory to use for schema information.


setSchemaFactory

void setSchemaFactory(SchemaFactory schemaFactory)
The SchemaFactory to use for schema information.


getSQLFactory

String getSQLFactory()
The SQL factory to use for SQL constructs.


getSQLFactoryInstance

SQLFactory getSQLFactoryInstance()
The SQL factory to use for SQL constructs.


setSQLFactory

void setSQLFactory(String sqlFactory)
The SQL factory to use for SQL constructs.


setSQLFactory

void setSQLFactory(SQLFactory sqlFactory)
The SQL factory to use for SQL constructs.


getMappingFactory

String getMappingFactory()
A plugin string describing the MetaDataFactory to use for loading and storing object-relational mapping data.


setMappingFactory

void setMappingFactory(String mappingFactory)
A plugin string describing the MetaDataFactory to use for loading and storing object-relational mapping data.


getMappingDefaults

String getMappingDefaults()
A plugin string describing the MappingDefaults to use.

Since:
0.4.0

setMappingDefaults

void setMappingDefaults(String map)
A plugin string describing the MappingDefaults to use.

Since:
0.4.0

getMappingDefaultsInstance

MappingDefaults getMappingDefaultsInstance()
The MappingDefaults to use with a repository.

Since:
0.4.0

setMappingDefaults

void setMappingDefaults(MappingDefaults map)
The MappingDefaults to use with a repository.

Since:
0.4.0

getMappingRepositoryInstance

MappingRepository getMappingRepositoryInstance()
Return the mapping repository. Convenience method to cast from the internal metadata repository.


newMappingRepositoryInstance

MappingRepository newMappingRepositoryInstance()
Return a new empty mapping repository of the configured type. Convenience method to cast from metadata repository.


getDataSource

DataSource getDataSource(StoreContext ctx)
Return the primary data source to use. The data source will automatically use the given context's user name and password on calls to DataSource.getConnection(). If the given context is null, the data source will use the configuration's default connection user name and password. If those too are null and the first context has been obtained already, then the user name and password for that context will be used, as we know they represent a valid combination. This method avoids casting the result of OpenJPAConfiguration.getConnectionFactory(), and avoids having to pass in the user name and password to obtain connections.


getDataSource2

DataSource getDataSource2(StoreContext ctx)
Return the non-enlisted data source to use. If there is a valid non-xa connection factory configured, then it will be returned. Its default user name and password on calls to DataSource.getConnection() will be the specificed connection 2 user name and password. If those are null and the given context is non-null, its user name password will be used instead. If the context is null too, then the user name and password used to retrieve the first context will be used. If there is no second connection factory the primary connection factory is used.

See Also:
getDataSource(org.apache.openjpa.kernel.StoreContext)


Copyright © 2006 Apache Software Foundation. All Rights Reserved.