Class DropTableConstraint
java.lang.Object
com.northconcepts.datapipeline.jdbc.sql.SqlPart
com.northconcepts.datapipeline.sql.h2.H2SqlPart
com.northconcepts.datapipeline.sql.h2.DropTableConstraint
Generates a ALTER TABLE...DROP CONSTRAINT statement for H2.
Sample Generated SQL:
ALTER TABLE person DROP CONSTRAINT email_check
-
Constructor Summary
ConstructorsConstructorDescriptionDropTableConstraint(String tableName, String constraintName) Constructs a DropTableConstraint with the specified table and constraint names. -
Method Summary
Modifier and TypeMethodDescriptionvoidcollectSqlFragment(CodeWriter writer) Writes this part's SQL to the writer; used bySqlPart.getSqlFragment()and by enclosing parts.Returns the constraint name.Returns the table name.setConstraintName(String constraintName) Sets the constraint name.setPretty(boolean pretty) Indicates ifSqlPart.getSqlFragment()adds line breaks and indentation instead of using one line (default is false).setTableName(String tableName) Sets the table name.Methods inherited from class com.northconcepts.datapipeline.sql.h2.H2SqlPart
escapeKeyword, placeBackTicksMethods inherited from class com.northconcepts.datapipeline.jdbc.sql.SqlPart
collectParameterValues, getParameterValues, getSqlFragment, isPretty, printSqlParts, toString
-
Constructor Details
-
DropTableConstraint
public DropTableConstraint() -
DropTableConstraint
Constructs a DropTableConstraint with the specified table and constraint names.- Parameters:
tableName- the table nameconstraintName- the constraint name
-
-
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
Returns the table name.- Returns:
- the table name
-
setTableName
Sets the table name.- Parameters:
tableName- the table name- Returns:
- this instance
-
getConstraintName
Returns the constraint name.- Returns:
- the constraint name
-
setConstraintName
Sets the constraint name.- Parameters:
constraintName- the constraint name- Returns:
- this instance
-