Class OracleAdapter

java.lang.Object
org.apache.cayenne.dba.JdbcAdapter
org.apache.cayenne.dba.oracle.OracleAdapter
All Implemented Interfaces:
DbAdapter

public class OracleAdapter extends JdbcAdapter
DbAdapter implementation for Oracle RDBMS
  • Field Details

  • Constructor Details

  • Method Details

    • initDriverInformation

      protected static void initDriverInformation()
    • isSupportsOracleLOB

      public static boolean isSupportsOracleLOB()
    • getOracleCursorType

      public static int getOracleCursorType()
      Returns an Oracle JDBC extension type defined in oracle.jdbc.driver.OracleTypes.CURSOR. This value is determined from Oracle driver classes via reflection in runtime, so that Cayenne code has no compile dependency on the driver. This means that calling this method when the driver is not available will result in an exception.
    • createNativeTypes

      protected NativeColumnType[] createNativeTypes()
      Description copied from class: JdbcAdapter
      Returns the database-native types supported by this adapter.
      Overrides:
      createNativeTypes in class JdbcAdapter
    • createPkGenerator

      public PkGenerator createPkGenerator()
      Specified by:
      createPkGenerator in interface DbAdapter
      Overrides:
      createPkGenerator in class JdbcAdapter
    • getSqlTreeProcessor

      public SQLTreeProcessor getSqlTreeProcessor()
      Specified by:
      getSqlTreeProcessor in interface DbAdapter
      Overrides:
      getSqlTreeProcessor in class JdbcAdapter
      Returns:
      SQLTreeProcessor that can adjust SQL tree to specific database flavour
      Since:
      4.2
    • createEJBQLTranslator

      protected EJBQLTranslator createEJBQLTranslator()
      Description copied from class: JdbcAdapter
      Creates and returns an EJBQLTranslator used to generate visitors for EJBQL to SQL translations. This method should be overriden by subclasses that need to customize EJBQL generation.
      Overrides:
      createEJBQLTranslator in class JdbcAdapter
      Since:
      3.0
    • configureExtendedTypes

      protected void configureExtendedTypes(ExtendedTypeMap map)
      Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.
      Overrides:
      configureExtendedTypes in class JdbcAdapter
    • dropTableStatements

      public Collection<String> dropTableStatements(DbEntity table)
      Returns a query string to drop a table corresponding to ent DbEntity. Changes superclass behavior to drop all related foreign key constraints.
      Specified by:
      dropTableStatements in interface DbAdapter
      Overrides:
      dropTableStatements in class JdbcAdapter
      Since:
      3.0
    • bind

      protected void bind(PreparedStatement statement, Object value, int psPosition, int psType, int psScale, ExtendedType binder) throws Exception
      Description copied from class: JdbcAdapter
      Binds a raw value to a statement parameter. This is the single extension point shared by both bindParameter overloads; adapters that need database-specific handling (e.g. of NULLs) should override this method rather than the public overloads.
      Overrides:
      bind in class JdbcAdapter
      Throws:
      Exception
    • buildAttribute

      public DbAttribute buildAttribute(String name, String typeName, int type, int maxLength, int scale, boolean allowNulls)
      Fixes some reverse engineering problems. Namely if a columns is created as DECIMAL and has non-positive precision it is converted to INTEGER.
      Specified by:
      buildAttribute in interface DbAdapter
      Overrides:
      buildAttribute in class JdbcAdapter
      Parameters:
      name - database column name
      typeName - database specific type name, may be used as a hint to determine the right JDBC type.
      type - JDBC column type
      maxLength - database column size (ignored if less than zero)
      scale - database column scale, i.e. the number of decimal digits (ignored if less than zero)
      allowNulls - database column nullable parameter
    • 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 JdbcAdapter
      Since:
      1.2
    • getSystemSchemas

      public List<String> getSystemSchemas()
      Specified by:
      getSystemSchemas in interface DbAdapter
      Overrides:
      getSystemSchemas in class JdbcAdapter
      Returns:
      list of system schemas
    • 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 JdbcAdapter
      Parameters:
      type - sql type code
      Returns:
      true if a given type supports scale
      Since:
      5.0