public class CreateIndex extends PostgresSqlPart
Generates a CREATE INDEX
statement for PostgreSQL.
CREATE UNIQUE INDEX "idx_firstname_lastname" ON "person" ("firstname", "lastname");
Constructor and Description |
---|
CreateIndex() |
CreateIndex(String indexName,
String tableName,
String... columnNames) |
Modifier and Type | Method and Description |
---|---|
void |
collectSqlFragment(CodeWriter writer) |
List<String> |
getColumnNames() |
String |
getIndexName() |
String |
getTableName() |
boolean |
isCheckIfNotExists()
Indicates if
IF NOT EXISTS clause should be included in the CREATE INDEX statement (default true). |
boolean |
isUnique() |
CreateIndex |
setCheckIfNotExists(boolean checkIfNotExists)
Indicates if
IF NOT EXISTS clause should be included in the CREATE INDEX statement (default true). |
CreateIndex |
setColumnNames(List<String> columnNames) |
CreateIndex |
setColumnNames(String... columnNames) |
CreateIndex |
setIndexName(String indexName) |
CreateIndex |
setPretty(boolean pretty) |
CreateIndex |
setTableName(String tableName) |
CreateIndex |
setUnique(boolean unique) |
escapeKeyword
collectParameterValues, getParameterValues, getSqlFragment, isPretty, printSqlParts, toString
public CreateIndex setPretty(boolean pretty)
public void collectSqlFragment(CodeWriter writer)
collectSqlFragment
in class SqlPart
public String getIndexName()
public CreateIndex setIndexName(String indexName)
public String getTableName()
public CreateIndex setTableName(String tableName)
public CreateIndex setColumnNames(List<String> columnNames)
public CreateIndex setColumnNames(String... columnNames)
public boolean isUnique()
public CreateIndex setUnique(boolean unique)
public boolean isCheckIfNotExists()
IF NOT EXISTS
clause should be included in the CREATE INDEX
statement (default true).public CreateIndex setCheckIfNotExists(boolean checkIfNotExists)
IF NOT EXISTS
clause should be included in the CREATE INDEX
statement (default true).Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.