Class CreateIndex
java.lang.Object
com.northconcepts.datapipeline.jdbc.sql.SqlPart
com.northconcepts.datapipeline.sql.mysql.MySqlPart
com.northconcepts.datapipeline.sql.mysql.CreateIndex
Generates a CREATE INDEX statement for MySQL.
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.booleanisUnique()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.mysql.MySqlPart
escapeKeyword, placeBackTicksMethods 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
-