Class DropTableConstraint
java.lang.Object
com.northconcepts.datapipeline.jdbc.sql.SqlPart
com.northconcepts.datapipeline.sql.postgresql.PostgresSqlPart
com.northconcepts.datapipeline.sql.postgresql.DropTableConstraint
Generates a ALTER TABLE...DROP CONSTRAINT statement for PostgreSQL.
Sample Generated SQL:
ALTER TABLE IF EXISTS "person" DROP CONSTRAINT IF EXISTS "email_check"
-
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 added to theALTER TABLE...DROP CONSTRAINTstatement before the constraint name (default true).booleanIndicates if theIF EXISTSclause should be added to theALTER TABLEstatement before the table name (default true).booleanReturns the inverse ofisCascade(); noRESTRICTkeyword is ever written.setCascade(boolean cascade) setCheckIfConstraintExists(boolean checkIfConstraintExists) Indicates ifIF EXISTSclause should be added to theALTER TABLE...DROP CONSTRAINTstatement before the constraint name (default true).setCheckIfTableExists(boolean checkIfTableExists) Indicates if theIF EXISTSclause should be added to theALTER TABLEstatement before the table name (default true).setConstraintName(String constraintName) setPretty(boolean pretty) Indicates ifSqlPart.getSqlFragment()adds line breaks and indentation instead of using one line (default is false).setTableName(String tableName) 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
-
DropTableConstraint
public DropTableConstraint() -
DropTableConstraint
-
-
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
-
getTableName
-
setTableName
-
getConstraintName
-
setConstraintName
-
isCheckIfTableExists
public boolean isCheckIfTableExists()Indicates if theIF EXISTSclause should be added to theALTER TABLEstatement before the table name (default true). -
setCheckIfTableExists
Indicates if theIF EXISTSclause should be added to theALTER TABLEstatement before the table name (default true). -
isCheckIfConstraintExists
public boolean isCheckIfConstraintExists()Indicates ifIF EXISTSclause should be added to theALTER TABLE...DROP CONSTRAINTstatement before the constraint name (default true). -
setCheckIfConstraintExists
Indicates ifIF EXISTSclause should be added to theALTER TABLE...DROP CONSTRAINTstatement before the constraint name (default true). -
isCascade
public boolean isCascade() -
setCascade
-
isRestrict
public boolean isRestrict()Returns the inverse ofisCascade(); noRESTRICTkeyword is ever written.
-