Interface JDBCConfiguration

    • Field Detail

      • LOG_SQL

        static final java.lang.String LOG_SQL
        Name of the logger for SQL execution messages: openjpa.jdbc.SQL.
        See Also:
        Constant Field Values
      • LOG_DIAG

        static final java.lang.String LOG_DIAG
        Name of the logger for additional jdbc messages: openjpa.jdbc.DIAG.
        See Also:
        Constant Field Values
      • LOG_JDBC

        static final java.lang.String LOG_JDBC
        Name of the logger for JDBC-related messages: openjpa.jdbc.JDBC.
        See Also:
        Constant Field Values
      • LOG_SCHEMA

        static final java.lang.String LOG_SCHEMA
        Name of the logger for schema-related messages: openjpa.jdbc.Schema.
        See Also:
        Constant Field Values
    • Method Detail

      • getSchema

        java.lang.String getSchema()
        Default schema for unqualified tables.
      • setSchema

        void setSchema​(java.lang.String schema)
        Default schema for unqualified tables.
      • getSchemas

        java.lang.String getSchemas()
        Comma-separated list of modifiable schemas for persistent instances.
      • setSchemas

        void setSchemas​(java.lang.String schemas)
        Comma-separated list of modifiable schemas for persistent instances.
      • getSchemasList

        java.lang.String[] getSchemasList()
        Modificable schema components.
      • setSchemas

        void setSchemas​(java.lang.String[] schemas)
        Modifiable schema components.
      • getTransactionIsolation

        java.lang.String getTransactionIsolation()
        The transaction isolation level to use at the database level. Possible values are:
        • default: The JDBC driver's default isolation level.
        • none: The standard JDBC Connection.TRANSACTION_NONE level.
        • read-committed: The standard JDBC Connection.TRANSACTION_READ_COMMITTED level.
        • read-uncommitted: The standard JDBC Connection.TRANSACTION_READ_UNCOMMITTED level.
        • repeatable-read: The standard JDBC Connection.TRANSACTION_REPEATABLE_READ level.
        • serializable: The standard JDBC Connection.TRANSACTION_SERIALIZABLE level.
      • setTransactionIsolation

        void setTransactionIsolation​(java.lang.String level)
        The transaction isolation level to use at the database level. Possible values are:
        • default: The JDBC driver's default isolation level.
        • none: The standard JDBC Connection.TRANSACTION_NONE level.
        • read-committed: The standard JDBC Connection.TRANSACTION_READ_COMMITTED level.
        • read-uncommitted: The standard JDBC Connection.TRANSACTION_READ_UNCOMMITTED level.
        • repeatable-read: The standard JDBC Connection.TRANSACTION_REPEATABLE_READ level.
        • serializable: The standard JDBC Connection.TRANSACTION_SERIALIZABLE level.
      • 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

        java.lang.String getResultSetType()
        The JDBC result set type. Defaults to forward-only.
        • forward-only: The standard JDBC ResultSet.TYPE_FORWARD_ONLY type.
        • scroll-sensitive: The standard JDBC ResultSet.TYPE_SCROLL_SENSITIVE type.
        • scroll-insensitive: The standard JDBC ResultSet.TYPE_SCROLL_INSENSITIVE type.
      • getResultSetTypeConstant

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

        void setResultSetType​(java.lang.String type)
        The JDBC result set type. Defaults to forward-only.
        • forward-only: The standard JDBC ResultSet.TYPE_FORWARD_ONLY type.
        • scroll-sensitive: The standard JDBC ResultSet.TYPE_SCROLL_SENSITIVE type.
        • scroll-insensitive: The standard JDBC ResultSet.TYPE_SCROLL_INSENSITIVE type.
      • setResultSetType

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

        java.lang.String getFetchDirection()
        The JDBC fetch direction. Defaults to forward.
        • forward: The standard JDBC ResultSet.FETCH_FORWARD direction.
        • reverse: The standard JDBC ResultSet.FETCH_REVERSE direction.
        • unknown: The standard JDBC ResultSet.FETCH_UNKNOWN direction.
      • getFetchDirectionConstant

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

        void setFetchDirection​(java.lang.String direction)
        The JDBC fetch direction. Defaults to forward.
        • forward: The standard JDBC ResultSet.FETCH_FORWARD direction.
        • reverse: The standard JDBC ResultSet.FETCH_REVERSE direction.
        • unknown: The standard JDBC ResultSet.FETCH_UNKNOWN direction.
      • setFetchDirection

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

        java.lang.String getEagerFetchMode()
        Specifies the default eager fetch mode to use. Defaults to parallel unless the query is by-oid. Possible values are:
        • none: When querying for an object, do not try to select for related objects at the same time.
        • join: When querying for objects, also select for 1-1 relations in the configured fetch groups using joins.
        • parallel: When querying for objects, also select for both 1-1 relations using joins and to-many relations using batched selects.
        Since:
        0.3.0
      • setEagerFetchMode

        void setEagerFetchMode​(java.lang.String mode)
        Specifies the default eager fetch mode to use. Defaults to parallel unless the query is by-oid. Possible values are:
        • none: When querying for an object, do not try to select for related objects at the same time.
        • join: When querying for objects, also select for 1-1 relations in the configured fetch groups using joins.
        • parallel: When querying for objects, also select for both 1-1 relations using joins and to-many relations using batched selects.
      • getSubclassFetchMode

        java.lang.String getSubclassFetchMode()
        Specifies the default subclass fetch mode to use. Defaults to join unless the query is by-oid. Possible values are:
        • none: Only select base class data.
        • join: Select both base class and all possible subclass data using joins.
        • parallel: Select for each possible subclass separately.
        Since:
        0.3.2
      • setSubclassFetchMode

        void setSubclassFetchMode​(java.lang.String mode)
        Specifies the default subclass fetch mode to use. Defaults to join unless the query is by-oid. Possible values are:
        • none: Only select base class data.
        • join: Select both base class and all possible subclass data using joins.
        • parallel: Select for each possible subclass separately.
        Since:
        0.3.2
      • getLRSSize

        java.lang.String getLRSSize()
        How to obtain the size of large result sets. Defaults to unknown.
        • unknown: Do not attempt to calculate the size of large result sets; return Integer.MAX_VALUE.
        • last: For result sets that support random access, calculate the size using ResultSet.last().
        • query: Use a separate COUNT query to calculate the size of the results.
      • getLRSSizeConstant

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

        void setLRSSize​(java.lang.String lrsSize)
        How to obtain the size of large result sets. Defaults to unknown.
        • unknown: Do not attempt to calculate the size of large result sets; return Integer.MAX_VALUE.
        • last: For result sets that support random access, calculate the size using ResultSet.last().
        • query: Use a separate COUNT query to calculate the size of the results.
      • setLRSSize

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

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

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

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

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

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

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

        java.lang.String getDBDictionary()
        The DBDictionary to use to define the RDBMS SQL information.
      • setDBDictionary

        void setDBDictionary​(java.lang.String dbdictionary)
        The DBDictionary to use to define the RDBMS SQL information.
      • getUpdateManager

        java.lang.String getUpdateManager()
        The UpdateManager to use for managing SQL updates.
      • setUpdateManager

        void setUpdateManager​(java.lang.String updateManager)
        The UpdateManager to use for managing SQL updates.
      • getDriverDataSource

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

        void setDriverDataSource​(java.lang.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

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

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

        java.lang.String getSQLFactory()
        The SQL factory to use for SQL constructs.
      • getSQLFactoryInstance

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

        void setSQLFactory​(java.lang.String sqlFactory)
        The SQL factory to use for SQL constructs.
      • setSQLFactory

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

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

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

        java.lang.String getMappingDefaults()
        A plugin string describing the MappingDefaults to use.
        Since:
        0.4.0
      • setMappingDefaults

        void setMappingDefaults​(java.lang.String map)
        A plugin string describing the MappingDefaults to use.
        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

        javax.sql.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

        javax.sql.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 specified 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)
      • getIdentifierUtil

        java.lang.String getIdentifierUtil()
        Gets the String constant that matches the IdentifierUtil
        Returns:
        String-based name of the IdentifierUtil