Package ru.curs.celesta.score
Class Index
- java.lang.Object
-
- ru.curs.celesta.score.NamedElement
-
- ru.curs.celesta.score.GrainElement
-
- ru.curs.celesta.score.Index
-
- All Implemented Interfaces:
HasColumns
public class Index extends GrainElement implements HasColumns
Table index. Celesta permits only creation of simple indices without UNIQUE restriction.
-
-
Field Summary
-
Fields inherited from class ru.curs.celesta.score.NamedElement
MAX_IDENTIFIER_LENGTH
-
-
Constructor Summary
Constructors Constructor Description Index(BasicTable t, String name, String[] columns)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete()Deletes the index.intgetColumnIndex(String name)Column index in the list of columns.Map<String,Column<?>>getColumns()Returns columns of the index.BasicTablegetTable()Returns table of the index.booleanisUnique()If the index is unique.voidsetUnique(boolean unique)Sets the "unique" property for the index.-
Methods inherited from class ru.curs.celesta.score.GrainElement
getGrain, getGrainPart
-
Methods inherited from class ru.curs.celesta.score.NamedElement
equals, getCelestaDoc, getName, getQuotedName, getQuotedNameIfNeeded, hashCode, limitName, limitName, setCelestaDoc
-
-
-
-
Constructor Detail
-
Index
public Index(BasicTable t, String name, String[] columns) throws ParseException
- Throws:
ParseException
-
-
Method Detail
-
getTable
public BasicTable getTable()
Returns table of the index.
-
getColumns
public Map<String,Column<?>> getColumns()
Returns columns of the index.- Specified by:
getColumnsin interfaceHasColumns
-
delete
public void delete() throws ParseExceptionDeletes the index.- Throws:
ParseException- when trying to change the system grain
-
getColumnIndex
public int getColumnIndex(String name)
Description copied from interface:HasColumnsColumn index in the list of columns.- Specified by:
getColumnIndexin interfaceHasColumns- Parameters:
name- column name.
-
isUnique
public boolean isUnique()
If the index is unique.
-
setUnique
public void setUnique(boolean unique) throws ParseExceptionSets the "unique" property for the index.- Parameters:
unique- uniqueness value- Throws:
ParseException
-
-