Class OracleDatabaseAdapter

java.lang.Object
org.apache.nifi.processors.standard.db.impl.OracleDatabaseAdapter
All Implemented Interfaces:
DatabaseAdapter

public class OracleDatabaseAdapter extends Object implements DatabaseAdapter
A DatabaseAdapter that generates Oracle-compliant SQL.
  • Constructor Details

    • OracleDatabaseAdapter

      public OracleDatabaseAdapter()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface DatabaseAdapter
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface DatabaseAdapter
    • getSelectStatement

      public String getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset)
      Description copied from interface: DatabaseAdapter
      Returns a SQL SELECT statement with the given clauses applied.
      Specified by:
      getSelectStatement in interface DatabaseAdapter
      Parameters:
      tableName - The name of the table to fetch rows from
      columnNames - The names of the columns to fetch from the table
      whereClause - The filter to apply to the statement. This should not include the WHERE keyword
      orderByClause - The columns/clause used for ordering the result rows. This should not include the ORDER BY keywords
      limit - The value for the LIMIT clause (i.e. the number of rows to return)
      offset - The value for the OFFSET clause (i.e. the number of rows to skip)
      Returns:
      A String containing a SQL SELECT statement with the given clauses applied
    • getSelectStatement

      public String getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset, String columnForPartitioning)
      Description copied from interface: DatabaseAdapter
      Returns a SQL SELECT statement with the given clauses applied. Note that if this method is overridden, the other overloaded methods need to be overridden as well, to call this method with columnForPartitioning = false
      Specified by:
      getSelectStatement in interface DatabaseAdapter
      Parameters:
      tableName - The name of the table to fetch rows from
      columnNames - The names of the columns to fetch from the table
      whereClause - The filter to apply to the statement. This should not include the WHERE keyword
      orderByClause - The columns/clause used for ordering the result rows. This should not include the ORDER BY keywords
      limit - The value for the LIMIT clause (i.e. the number of rows to return)
      offset - The value for the OFFSET clause (i.e. the number of rows to skip)
      columnForPartitioning - The (optional) column name that, if provided, the limit and offset values are based on values from the column itself (rather than the row number)
      Returns:
      A String containing a SQL SELECT statement with the given clauses applied
    • getTableAliasClause

      public String getTableAliasClause(String tableName)
      Specified by:
      getTableAliasClause in interface DatabaseAdapter
    • getAlterTableStatement

      public String getAlterTableStatement(String tableName, List<ColumnDescription> columnsToAdd)
      Specified by:
      getAlterTableStatement in interface DatabaseAdapter
    • getSQLForDataType

      public String getSQLForDataType(int sqlType)
      Specified by:
      getSQLForDataType in interface DatabaseAdapter
    • supportsCreateTableIfNotExists

      public boolean supportsCreateTableIfNotExists()
      Specified by:
      supportsCreateTableIfNotExists in interface DatabaseAdapter
    • getCreateTableStatement

      public String getCreateTableStatement(TableSchema tableSchema)
      Generates a CREATE TABLE statement using the specified table schema
      Specified by:
      getCreateTableStatement in interface DatabaseAdapter
      Parameters:
      tableSchema - The table schema including column information
      Returns:
      A String containing DDL to create the specified table