Package com.gengoai.sql.object
Class Index
- java.lang.Object
-
- com.gengoai.sql.object.SQLObject
-
- com.gengoai.sql.object.Index
-
- All Implemented Interfaces:
NamedSQLElement
,SQLElement
,Serializable
public class Index extends SQLObject
Represents an index on one or more columns in a table.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Index(@NonNull Table table, @NonNull List<SQLElement> columns)
Instantiates a new Index.Index(@NonNull SQLElement table, String name, boolean isUnique, @NonNull List<SQLElement> columns)
Instantiates a new Index.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Drop
dropIndex(String name)
static Drop
dropIndexIfExists(String name)
String
getKeyword()
Gets the SQL Keyword associated with the objectstatic IndexBuilder
index(String name, @NonNull SQLElement table)
String
toString()
-
Methods inherited from class com.gengoai.sql.object.SQLObject
create, create, createIfNotExists, drop, drop, dropIfExists, getName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.gengoai.sql.SQLElement
getClassName
-
-
-
-
Constructor Detail
-
Index
public Index(@NonNull @NonNull Table table, @NonNull @NonNull List<SQLElement> columns)
Instantiates a new Index.- Parameters:
table
- the table containing the columns to indexcolumns
- the columns to index
-
Index
public Index(@NonNull @NonNull SQLElement table, String name, boolean isUnique, @NonNull @NonNull List<SQLElement> columns)
Instantiates a new Index.- Parameters:
table
- the table containing the columns to indexname
- the name of the indexisUnique
- will the index have a unique constraintcolumns
- the columns to index
-
-
Method Detail
-
index
public static IndexBuilder index(String name, @NonNull @NonNull SQLElement table)
-
getKeyword
public String getKeyword()
Description copied from class:SQLObject
Gets the SQL Keyword associated with the object- Specified by:
getKeyword
in classSQLObject
- Returns:
- the SQL keyword
-
-