Class DropColumn
- java.lang.Object
-
- org.linuxforhealth.fhir.database.utils.common.DropColumn
-
- All Implemented Interfaces:
IDatabaseStatement
public class DropColumn extends java.lang.Object implements IDatabaseStatement
Drop columns from the schema.table
-
-
Constructor Summary
Constructors Constructor Description DropColumn(java.lang.String schemaName, java.lang.String tableName, boolean ignoreError, java.lang.String... columnName)
Public constructorDropColumn(java.lang.String schemaName, java.lang.String tableName, java.lang.String... columnName)
Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
getColumnNames()
java.lang.String
getSchemaName()
java.lang.String
getTableName()
boolean
postgresColumnExists(IDatabaseTranslator translator, java.sql.Connection c, java.lang.String columnName)
Special check that the column exists before we try to drop itvoid
run(IDatabaseTranslator translator, java.sql.Connection c)
Execute the statement using the connection.
-
-
-
Constructor Detail
-
DropColumn
public DropColumn(java.lang.String schemaName, java.lang.String tableName, java.lang.String... columnName)
Public constructor- Parameters:
schemaName
-tableName
-columnName
-
-
DropColumn
public DropColumn(java.lang.String schemaName, java.lang.String tableName, boolean ignoreError, java.lang.String... columnName)
Public constructor- Parameters:
schemaName
-tableName
-ignoreError
-columnName
-
-
-
Method Detail
-
run
public void run(IDatabaseTranslator translator, java.sql.Connection c)
Description copied from interface:IDatabaseStatement
Execute the statement using the connection.- Specified by:
run
in interfaceIDatabaseStatement
- Parameters:
translator
- to translate any exceptions
-
postgresColumnExists
public boolean postgresColumnExists(IDatabaseTranslator translator, java.sql.Connection c, java.lang.String columnName)
Special check that the column exists before we try to drop it- Parameters:
columnName
-- Returns:
-
getSchemaName
public java.lang.String getSchemaName()
- Returns:
- the schemaName
-
getTableName
public java.lang.String getTableName()
- Returns:
- the tableName
-
getColumnNames
public java.util.List<java.lang.String> getColumnNames()
- Returns:
- the columnNames
-
-