Class MySQLDatabaseAdapter
java.lang.Object
org.apache.nifi.processors.standard.db.impl.GenericDatabaseAdapter
org.apache.nifi.processors.standard.db.impl.MySQLDatabaseAdapter
- All Implemented Interfaces:
DatabaseAdapter
A generic database adapter that generates MySQL compatible SQL.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAlterTableStatement(String tableName, List<ColumnDescription> columnsToAdd) getInsertIgnoreStatement(String table, List<String> columnNames, Collection<String> uniqueKeyColumnNames) Returns an SQL INSERT_IGNORE statement - i.e.getName()getSQLForDataType(int sqlType) getUpsertStatement(String table, List<String> columnNames, Collection<String> uniqueKeyColumnNames) Returns an SQL UPSERT statement - i.e.booleanbooleanTells whether this adapter supports INSERT_IGNORE.booleanTells whether this adapter supports UPSERT.Methods inherited from class org.apache.nifi.processors.standard.db.impl.GenericDatabaseAdapter
getSelectStatement, getSelectStatementMethods 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, getCreateTableStatement, getTableAliasClause
-
Constructor Details
-
MySQLDatabaseAdapter
public MySQLDatabaseAdapter()
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceDatabaseAdapter- Overrides:
getNamein classGenericDatabaseAdapter
-
getDescription
- Specified by:
getDescriptionin interfaceDatabaseAdapter- Overrides:
getDescriptionin classGenericDatabaseAdapter
-
supportsUpsert
public boolean supportsUpsert()Description copied from interface:DatabaseAdapterTells whether this adapter supports UPSERT.- Returns:
- true if UPSERT is supported, false otherwise
-
supportsInsertIgnore
public boolean supportsInsertIgnore()Description copied from interface:DatabaseAdapterTells whether this adapter supports INSERT_IGNORE.- Returns:
- true if INSERT_IGNORE is supported, false otherwise
-
getUpsertStatement
public String getUpsertStatement(String table, List<String> columnNames, Collection<String> uniqueKeyColumnNames) 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()!- 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.
-
getInsertIgnoreStatement
public String getInsertIgnoreStatement(String table, List<String> columnNames, Collection<String> uniqueKeyColumnNames) Description copied from interface:DatabaseAdapterReturns an SQL INSERT_IGNORE statement - i.e. Ignore 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.supportsInsertIgnore()!- Parameters:
table- The name of the table in which to ignore/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.
-
supportsCreateTableIfNotExists
public boolean supportsCreateTableIfNotExists() -
getAlterTableStatement
-
getSQLForDataType
-