Class Oracle12DatabaseAdapter
java.lang.Object
org.apache.nifi.processors.standard.db.impl.Oracle12DatabaseAdapter
- All Implemented Interfaces:
DatabaseAdapter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAlterTableStatement(String tableName, List<ColumnDescription> columnsToAdd) private StringgetColumnAssignment(String table, String columnName, String newTableAlias) getColumnsAssignment(Collection<String> columnsNames, String newTableAlias, String table) getConflictColumnsClause(Collection<String> uniqueKeyColumnNames, List<String> conflictColumns, String table, String newTableAlias) getCreateTableStatement(TableSchema tableSchema) Generates a CREATE TABLE statement using the specified table schemagetName()getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset) Returns a SQL SELECT statement with the given clauses applied.getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset, String columnForPartitioning) Returns a SQL SELECT statement with the given clauses applied.getSQLForDataType(int sqlType) getTableAliasClause(String tableName) getUpsertStatement(String table, List<String> columnNames, Collection<String> uniqueKeyColumnNames) Returns an SQL UPSERT statement - i.e.private StringnormalizeColumnName(String colName) booleanbooleanTells whether this adapter supports UPSERT.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.nifi.processors.standard.db.DatabaseAdapter
generateTableName, getAutoCommitForReads, getInsertIgnoreStatement, supportsInsertIgnore
-
Constructor Details
-
Oracle12DatabaseAdapter
public Oracle12DatabaseAdapter()
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceDatabaseAdapter
-
getDescription
- Specified by:
getDescriptionin interfaceDatabaseAdapter
-
getSelectStatement
public String getSelectStatement(String tableName, String columnNames, String whereClause, String orderByClause, Long limit, Long offset) Description copied from interface:DatabaseAdapterReturns a SQL SELECT statement with the given clauses applied.- Specified by:
getSelectStatementin interfaceDatabaseAdapter- Parameters:
tableName- The name of the table to fetch rows fromcolumnNames- The names of the columns to fetch from the tablewhereClause- The filter to apply to the statement. This should not include the WHERE keywordorderByClause- The columns/clause used for ordering the result rows. This should not include the ORDER BY keywordslimit- 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:DatabaseAdapterReturns 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:
getSelectStatementin interfaceDatabaseAdapter- Parameters:
tableName- The name of the table to fetch rows fromcolumnNames- The names of the columns to fetch from the tablewhereClause- The filter to apply to the statement. This should not include the WHERE keywordorderByClause- The columns/clause used for ordering the result rows. This should not include the ORDER BY keywordslimit- 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
- Specified by:
getTableAliasClausein interfaceDatabaseAdapter
-
supportsUpsert
public boolean supportsUpsert()Description copied from interface:DatabaseAdapterTells whether this adapter supports UPSERT.- Specified by:
supportsUpsertin interfaceDatabaseAdapter- Returns:
- true if UPSERT is supported, false otherwise
-
getUpsertStatement
public String getUpsertStatement(String table, List<String> columnNames, Collection<String> uniqueKeyColumnNames) throws IllegalArgumentException Description copied from interface:DatabaseAdapterReturns an SQL UPSERT statement - i.e. UPDATE record or INSERT if id doesn't exist.
There is no standard way of doing this so not all adapters support it - use together withDatabaseAdapter.supportsUpsert()!- Specified by:
getUpsertStatementin interfaceDatabaseAdapter- Parameters:
table- The name of the table in which to update/insert a record into.columnNames- The name of the columns in the table to add values to.uniqueKeyColumnNames- The name of the columns that form a unique key.- Returns:
- A String containing the parameterized jdbc SQL statement. The order and number of parameters are the same as that of the provided column list.
- Throws:
IllegalArgumentException
-
getConflictColumnsClause
-
normalizeColumnName
-
getColumnsAssignment
-
getColumnAssignment
-
getAlterTableStatement
- Specified by:
getAlterTableStatementin interfaceDatabaseAdapter
-
getSQLForDataType
- Specified by:
getSQLForDataTypein interfaceDatabaseAdapter
-
supportsCreateTableIfNotExists
public boolean supportsCreateTableIfNotExists()- Specified by:
supportsCreateTableIfNotExistsin interfaceDatabaseAdapter
-
getCreateTableStatement
Generates a CREATE TABLE statement using the specified table schema- Specified by:
getCreateTableStatementin interfaceDatabaseAdapter- Parameters:
tableSchema- The table schema including column information- Returns:
- A String containing DDL to create the specified table
-