public class IndexDef extends SchemaPart implements Cloneable, SchemaProblemsSupplier, JavaCodeGenerator
internalId, internalName, log, TIMESTAMP_FORMATSERIALIZED_CLASS_NAME, TYPEXML_SERIALIZED_CLASS_NAME| Constructor and Description |
|---|
IndexDef() |
IndexDef(String name,
String... indexFieldNames) |
| Modifier and Type | Method and Description |
|---|---|
IndexDef |
addIndexField(IndexFieldDef indexField) |
IndexDef |
addIndexFields(String... indexFieldNames) |
IndexDef |
clone() |
boolean |
containsField(String name)
Returns true if this index contains an
IndexFieldDef with the specified name. |
boolean |
equals(Object obj) |
IndexDef |
fromRecord(Record source)
Loads this instance's state from a record and returns
this (for fluid API call chaining). |
IndexDef |
fromXmlElement(Element indexDefElement) |
void |
generateJavaCode(JavaCodeBuilder code) |
String |
getDescription() |
EntityDef |
getEntityDef() |
String |
getEntityQualifiedName()
Returns the qualified name that includes the name of this index and the
EntityDef above it separated by period. |
IndexFieldDef |
getIndexField(String name)
Returns the
IndexFieldDef that matches the specified name. |
int |
getIndexFieldCount()
Returns the number of index fields in this index.
|
List<String> |
getIndexFieldNames()
Returns the names of all index fields in this index.
|
List<IndexFieldDef> |
getIndexFields() |
List<IndexFieldDef> |
getIndexFields(boolean create) |
String |
getName() |
String |
getQualifiedName()
Returns the fully qualified name that includes the name of this index and all names in its hierarchy separated by period.
|
SchemaDef |
getSchemaDef()
The schema of the parent entity containing this field.
|
SchemaDef |
getSchemaDef(boolean throwException) |
SchemaPart |
getSchemaPartContainer() |
String |
getSchemaPartName() |
SchemaPartType |
getSchemaPartType() |
void |
getSchemaProblems(List<SchemaProblem> problems,
boolean includeChildren) |
int |
hashCode() |
int |
indexOfField(String indexFieldName)
Returns the zero-based position of the
IndexDef with the specified name or -1 if it is not found. |
int |
indexOfField(String indexFieldName,
boolean throwExceptionOnFailure)
Returns the zero-based position of the
IndexFieldDef with the specified name or -1 if it is not found and throwExceptionOnFailure is false, otherwise a DataException is thrown. |
boolean |
isPrimaryKeyIndex() |
boolean |
isUnique() |
void |
moveField(int oldIndex,
int newIndex)
Moves the index field at the
oldIndex to the newIndex, shifting any existing elements at or after newIndex to the right. |
void |
moveField(String fieldName,
int newIndex)
Moves the index field with the given name to the
newIndex, shifting any existing elements at or after newIndex to the right. |
void |
moveFieldAfter(String fieldName,
String afterFieldName)
Moves the index field with the given
fieldName after to the index field with the specified afterFieldName, shifting any existing elements after afterFieldName to the right. |
void |
moveFieldBefore(String fieldName,
String beforeFieldName)
Moves the index field with the given
fieldName before to the index field with the specified beforeFieldName, shifting elements at or after beforeFieldName to the right. |
IndexDef |
setDescription(String description) |
protected IndexDef |
setEntityDef(EntityDef entityDef) |
IndexDef |
setIndexFields(List<IndexFieldDef> indexFields) |
IndexDef |
setName(String name) |
IndexDef |
setUnique(boolean unique) |
String |
toJson() |
Record |
toRecord() |
Element |
toXmlElement(Document document) |
getSchemaName, getSchemaPartContainerName, getSchemaPartContainerTypeaddExceptionProperties, assertValid, assertValid, exception, exception, exception, getInternalId, getInternalName, resetInternalIdfinalize, getClass, notify, notifyAll, wait, wait, waitgetSchemaProblems, getSchemaProblemsfromArrayValue, fromArrayValue, fromArrayValue, fromJson, fromJson, newInstanceFromRecord, newInstanceFromRecord, toArrayValue, toJson, toJson, toRecordnewInstanceFromJsonforEachGrandChildElement, fromXml, fromXml, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getChildElement, getChildElements, newInstanceFromXml, newInstanceFromXml, setAttribute, toXml, toXml, toXml, toXml, toXml, writeXml, writeXmladdExceptionProperties, contributeExceptionProperties, contributeExceptionPropertiespublic void getSchemaProblems(List<SchemaProblem> problems, boolean includeChildren)
getSchemaProblems in interface SchemaProblemsSupplierpublic IndexDef clone()
clone in class FoundationObjectpublic void generateJavaCode(JavaCodeBuilder code)
generateJavaCode in interface JavaCodeGeneratorpublic SchemaDef getSchemaDef(boolean throwException)
public SchemaDef getSchemaDef()
getSchemaDef in class SchemaPartpublic SchemaPart getSchemaPartContainer()
getSchemaPartContainer in class SchemaPartpublic SchemaPartType getSchemaPartType()
getSchemaPartType in class SchemaPartpublic String getSchemaPartName()
getSchemaPartName in class SchemaPartpublic EntityDef getEntityDef()
public String getName()
public String getQualifiedName()
public String getEntityQualifiedName()
EntityDef above it separated by period.public String getDescription()
public boolean isUnique()
public IndexDef setUnique(boolean unique)
public boolean isPrimaryKeyIndex()
public boolean containsField(String name)
IndexFieldDef with the specified name.public int getIndexFieldCount()
public List<String> getIndexFieldNames()
public List<IndexFieldDef> getIndexFields(boolean create)
public IndexFieldDef getIndexField(String name)
IndexFieldDef that matches the specified name.public List<IndexFieldDef> getIndexFields()
public IndexDef setIndexFields(List<IndexFieldDef> indexFields)
public IndexDef addIndexField(IndexFieldDef indexField)
public Element toXmlElement(Document document)
toXmlElement in interface XmlSerializablepublic IndexDef fromXmlElement(Element indexDefElement)
fromXmlElement in interface XmlSerializablepublic String toJson()
toJson in interface JsonSerializabletoJson in interface RecordSerializablepublic Record toRecord()
toRecord in interface RecordSerializabletoRecord in class Beanpublic IndexDef fromRecord(Record source)
RecordSerializablethis (for fluid API call chaining).
For fluid API call chaining, the overridden method should change the declared return type to its class.fromRecord in interface RecordSerializablefromRecord in class Beanpublic int indexOfField(String indexFieldName)
IndexDef with the specified name or -1 if it is not found.public int indexOfField(String indexFieldName, boolean throwExceptionOnFailure)
IndexFieldDef with the specified name or -1 if it is not found and throwExceptionOnFailure is false, otherwise a DataException is thrown.public void moveField(int oldIndex,
int newIndex)
oldIndex to the newIndex, shifting any existing elements at or after newIndex to the right.public void moveField(String fieldName, int newIndex)
newIndex, shifting any existing elements at or after newIndex to the right.public void moveFieldBefore(String fieldName, String beforeFieldName)
fieldName before to the index field with the specified beforeFieldName, shifting elements at or after beforeFieldName to the right.Copyright (c) 2006-2025 North Concepts Inc. All Rights Reserved.