Oracle8Adapter (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.dba.oracle, class: Oracle8Adapter

# Class Oracle8Adapter

java.lang.Object
org.apache.cayenne.dba.JdbcAdapter
org.apache.cayenne.dba.oracle.OracleAdapter
org.apache.cayenne.dba.oracle.Oracle8Adapter

All Implemented Interfaces:
  `DbAdapter`

public class Oracle8Adapter extends OracleAdapter
A flavor of OracleAdapter that implements workarounds for some old driver limitations.

Since:
  1.2

- ## Field Summary

  ### Fields inherited from class OracleAdapter

  `initDone, NEW_BLOB_FUNCTION, NEW_CLOB_FUNCTION, ORACLE_BLOB, ORACLE_CLOB, ORACLE_FLOAT, ORACLE_NCLOB, oracleCursorType, supportsOracleLOB, TRIM_FUNCTION`
  Modifier and Type
  Field
  Description
  `protected static boolean`
  `initDone`
  `static final String`
  `NEW_BLOB_FUNCTION`
  `static final String`
  `NEW_CLOB_FUNCTION`
  `static final String`
  `ORACLE_BLOB`
  `static final String`
  `ORACLE_CLOB`
  `static final String`
  `ORACLE_FLOAT`
  `static final String`
  `ORACLE_NCLOB`
  `protected static int`
  `oracleCursorType`
  `protected static boolean`
  `supportsOracleLOB`
  `static final String`
  `TRIM_FUNCTION`

  ### Fields inherited from class JdbcAdapter

  `caseInsensitiveCollations, ejbqlTranslatorFactory, extendedTypes, logger, quotingStrategy, resourceLocator, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler`
  Modifier and Type
  Field
  Description
  `protected boolean`
  `caseInsensitiveCollations`
  `protected EJBQLTranslatorFactory`
  `ejbqlTranslatorFactory`
  `protected ExtendedTypeMap`
  `extendedTypes`
  `protected JdbcEventLogger`
  `logger`
  `protected QuotingStrategy`
  `quotingStrategy`
  `protected ResourceLocator`
  `resourceLocator`
  `protected boolean`
  `supportsBatchUpdates`
  `protected boolean`
  `supportsGeneratedKeys`
  `protected boolean`
  `supportsUniqueConstraints`
  `protected TypesHandler`
  `typesHandler`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Oracle8Adapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected URL`
  `findResource(String name)`
  Locates and returns a named adapter resource.
  `SQLAction`
  `getAction(Query query, DataNode node)`
  Uses OracleActionBuilder to create the right action.
  `boolean`
  `typeSupportsScale(int type)`
  Returns true if supplied type can have a scale attribute as a part of column definition.

  ### Methods inherited from class OracleAdapter

  `bindParameter, buildAttribute, configureExtendedTypes, createEJBQLTranslatorFactory, dropTableStatements, getOracleCursorType, getSqlTreeProcessor, getSystemSchemas, initDriverInformation, isSupportsOracleLOB`
  Modifier and Type
  Method
  Description
  `void`
  `bindParameter(PreparedStatement statement, ParameterBinding binding)`
  Binds an object value to PreparedStatement's parameter.
  `DbAttribute`
  `buildAttribute(String name, String typeName, int type, int size, int scale, boolean allowNulls)`
  Fixes some reverse engineering problems.
  `protected void`
  `configureExtendedTypes(ExtendedTypeMap map)`
  Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.
  `protected EJBQLTranslatorFactory`
  `createEJBQLTranslatorFactory()`
  Creates and returns an `EJBQLTranslatorFactory` used to generate visitors for EJBQL to SQL translations.
  `Collection<String>`
  `dropTableStatements(DbEntity table)`
  Returns a query string to drop a table corresponding to `ent` DbEntity.
  `static int`
  `getOracleCursorType()`
  Returns an Oracle JDBC extension type defined in oracle.jdbc.driver.OracleTypes.CURSOR.
  `SQLTreeProcessor`
  `getSqlTreeProcessor()`
  `List<String>`
  `getSystemSchemas()`
  `protected static void`
  `initDriverInformation()`
  `static boolean`
  `isSupportsOracleLOB()`

  ### Methods inherited from class JdbcAdapter

  `createFkConstraint, createQuotingStrategy, createTable, createTableAppendColumn, createTableAppendPKClause, createUniqueConstraint, externalTypesForJdbcType, getBatchTerminator, getEjbqlTranslatorFactory, getExtendedTypes, getJdbcEventLogger, getPkGenerator, getQuotingStrategy, getSelectTranslator, getSystemCatalogs, getType, initExtendedTypes, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsGeneratedKeys, setSupportsUniqueConstraints, sizeAndPrecision, supportsBatchUpdates, supportsCatalogsOnReverseEngineering, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView, typeSupportsLength, unwrap`
  Modifier and Type
  Method
  Description
  `String`
  `createFkConstraint(DbRelationship rel)`
  Returns a SQL string that can be used to create a foreign key constraint for the relationship.
  `protected QuotingStrategy`
  `createQuotingStrategy()`
  `String`
  `createTable(DbEntity entity)`
  Returns a SQL string that can be used to create database table corresponding to `ent` parameter.
  `void`
  `createTableAppendColumn(StringBuffer sqlBuffer, DbAttribute column)`
  Appends SQL for column creation to CREATE TABLE buffer.
  `protected void`
  `createTableAppendPKClause(StringBuffer sqlBuffer, DbEntity entity)`
  `String`
  `createUniqueConstraint(DbEntity source, Collection<DbAttribute> columns)`
  Returns a DDL string to create a unique constraint over a set of columns.
  `String[]`
  `externalTypesForJdbcType(int type)`
  Returns an array of RDBMS types that can be used with JDBC `type`.
  `String`
  `getBatchTerminator()`
  Returns default separator - a semicolon.
  `EJBQLTranslatorFactory`
  `getEjbqlTranslatorFactory()`
  Returns a translator factory for EJBQL to SQL translation.
  `ExtendedTypeMap`
  `getExtendedTypes()`
  Returns a map of ExtendedTypes that is used to translate values between Java and JDBC layer.
  `JdbcEventLogger`
  `getJdbcEventLogger()`
  `PkGenerator`
  `getPkGenerator()`
  Returns primary key generator associated with this DbAdapter.
  `QuotingStrategy`
  `getQuotingStrategy()`
  Returns SQL identifier quoting strategy object
  `SelectTranslator`
  `getSelectTranslator(FluentSelect<?,?> query, EntityResolver entityResolver)`
  `List<String>`
  `getSystemCatalogs()`
  `static String`
  `getType(DbAdapter adapter, DbAttribute column)`
  `protected void`
  `initExtendedTypes(List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ValueObjectTypeRegistry valueObjectTypeRegistry)`
  `void`
  `setEjbqlTranslatorFactory(EJBQLTranslatorFactory ejbqlTranslatorFactory)`
  Sets a translator factory for EJBQL to SQL translation.
  `void`
  `setPkGenerator(PkGenerator pkGenerator)`
  Sets new primary key generator.
  `void`
  `setSupportsBatchUpdates(boolean flag)`
  `void`
  `setSupportsGeneratedKeys(boolean flag)`
  `void`
  `setSupportsUniqueConstraints(boolean flag)`
  `static String`
  `sizeAndPrecision(DbAdapter adapter, DbAttribute column)`
  `boolean`
  `supportsBatchUpdates()`
  Returns `true` if the target database supports batch updates.
  `boolean`
  `supportsCatalogsOnReverseEngineering()`
  Returns true.
  `boolean`
  `supportsGeneratedKeys()`
  Returns true if a target database supports key autogeneration.
  `boolean`
  `supportsUniqueConstraints()`
  Returns true.
  `String`
  `tableTypeForTable()`
  Returns the name of the table type (as returned by `DatabaseMetaData.getTableTypes`) for a simple user table.
  `String`
  `tableTypeForView()`
  Returns the name of the table type (as returned by `DatabaseMetaData.getTableTypes`) for a view table.
  `boolean`
  `typeSupportsLength(int type)`
  Returns true if supplied type can have a length attribute as a part of column definition
  `DbAdapter`
  `unwrap()`
  Simply returns this, as JdbcAdapter is not a wrapper.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface DbAdapter

  `supportsGeneratedKeysForBatchInserts`
  Modifier and Type
  Method
  Description
  `default boolean`
  `supportsGeneratedKeysForBatchInserts()`
  Returns true if a target database supports key autogeneration in a batch insert.

- ## Constructor Details

  - ### Oracle8Adapter

    public Oracle8Adapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry)

- ## Method Details

  - ### getAction

    public SQLAction getAction(Query query, DataNode node)
    Uses OracleActionBuilder to create the right action.
    Specified by:
      `getAction` in interface `DbAdapter`
    Overrides:
      `getAction` in class `OracleAdapter`

  - ### findResource

    protected URL findResource(String name)
    Description copied from class: `JdbcAdapter`
    Locates and returns a named adapter resource. A resource can be an XML file, etc.

    This implementation is based on the premise that each adapter is located in its own Java package and all resources are in the same package as well. Resource lookup is recursive, so that if DbAdapter is a subclass of another adapter, parent adapter package is searched as a failover.

    Overrides:
      `findResource` in class `JdbcAdapter`

  - ### typeSupportsScale

    public boolean typeSupportsScale(int type)
    Description copied from class: `JdbcAdapter`
    Returns true if supplied type can have a scale attribute as a part of column definition.
    Specified by:
      `typeSupportsScale` in interface `DbAdapter`
    Overrides:
      `typeSupportsScale` in class `OracleAdapter`
    Parameters:
      `type` - sql type code
    Returns:
      `true` if a given type supports scale
    Since:
      5.0