Class CreateIndex
java.lang.Object
com.northconcepts.datapipeline.jdbc.sql.SqlPart
com.northconcepts.datapipeline.sql.postgresql.PostgresSqlPart
com.northconcepts.datapipeline.sql.postgresql.CreateIndex
Generates a CREATE INDEX statement for PostgreSQL.
Sample Generated SQL:
CREATE UNIQUE INDEX "idx_firstname_lastname" ON "person" ("firstname", "lastname");
-
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.booleanIndicates ifIF NOT EXISTSclause should be included in theCREATE INDEXstatement (default true).booleanisUnique()setCheckIfNotExists(boolean checkIfNotExists) Indicates ifIF NOT EXISTSclause should be included in theCREATE INDEXstatement (default true).setColumnNames(String... columnNames) setColumnNames(List<String> columnNames) setIndexName(String indexName) setPretty(boolean pretty) Indicates ifSqlPart.getSqlFragment()adds line breaks and indentation instead of using one line (default is false).setTableName(String tableName) setUnique(boolean unique) 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
-
CreateIndex
public CreateIndex() -
CreateIndex
-
-
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
-
getIndexName
-
setIndexName
-
getTableName
-
setTableName
-
getColumnNames
-
setColumnNames
-
setColumnNames
-
isUnique
public boolean isUnique() -
setUnique
-
isCheckIfNotExists
public boolean isCheckIfNotExists()Indicates ifIF NOT EXISTSclause should be included in theCREATE INDEXstatement (default true). -
setCheckIfNotExists
Indicates ifIF NOT EXISTSclause should be included in theCREATE INDEXstatement (default true).
-