Class DropTable
java.lang.Object
com.northconcepts.datapipeline.jdbc.sql.SqlPart
com.northconcepts.datapipeline.sql.postgresql.PostgresSqlPart
com.northconcepts.datapipeline.sql.postgresql.DropTable
Generates a DROP TABLE statement for PostgreSQL.
Sample Generated SQL:
DROP TABLE IF EXISTS "person", "address" CASCADE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcollectSqlFragment(CodeWriter writer) Writes this part's SQL to the writer; used bySqlPart.getSqlFragment()and by enclosing parts.booleanbooleanIndicates ifIF EXISTSclause should be included in theDROP TABLEstatement (default true).booleanReturns the inverse ofisCascade(); noRESTRICTkeyword is ever written.setCascade(boolean cascade) setCheckIfExists(boolean checkIfExists) Indicates ifIF EXISTSclause should be included in theDROP TABLEstatement (default true).setPretty(boolean pretty) Indicates ifSqlPart.getSqlFragment()adds line breaks and indentation instead of using one line (default is false).setTableNames(String... tableNames) Replaces the tables to drop with the given names; null or an empty array is ignored.setTableNames(Collection<String> tableNames) Replaces the tables to drop with a copy of the given names; null is ignored.Methods inherited from class com.northconcepts.datapipeline.sql.postgresql.PostgresSqlPart
escapeKeywordMethods inherited from class com.northconcepts.datapipeline.jdbc.sql.SqlPart
collectParameterValues, getParameterValues, getSqlFragment, isPretty, printSqlParts, toString
-
Constructor Details
-
DropTable
public DropTable() -
DropTable
-
-
Method Details
-
setPretty
Description copied from class:SqlPartIndicates ifSqlPart.getSqlFragment()adds line breaks and indentation instead of using one line (default is false). -
collectSqlFragment
Description copied from class:SqlPartWrites this part's SQL to the writer; used bySqlPart.getSqlFragment()and by enclosing parts.- Specified by:
collectSqlFragmentin classSqlPart
-
getTableNames
-
setTableNames
Replaces the tables to drop with a copy of the given names; null is ignored. -
setTableNames
Replaces the tables to drop with the given names; null or an empty array is ignored. -
isCheckIfExists
public boolean isCheckIfExists()Indicates ifIF EXISTSclause should be included in theDROP TABLEstatement (default true). -
setCheckIfExists
Indicates ifIF EXISTSclause should be included in theDROP TABLEstatement (default true). -
isCascade
public boolean isCascade() -
setCascade
-
isRestrict
public boolean isRestrict()Returns the inverse ofisCascade(); noRESTRICTkeyword is ever written.
-