| Constructor and Description |
|---|
IndexImpl(EntityFactoryImpl factory,
Entity entity,
SourceInfo sourceInfo)
Creates an index.
|
| Modifier and Type | Method and Description |
|---|---|
ModelException |
createModelException(String message)
Creates a model exception.
|
List<IndexAttribute> |
getAttributes()
Gets the index attributes.
|
String |
getComment()
Gets the comment.
|
Entity |
getEntity()
Gets the entity this index belongs to.
|
String |
getFilterCondition()
Gets the optional filter condition.
|
String |
getName()
Gets the index name.
|
String |
getName(Entity entity)
Gets the index name for given entity.
|
ConfigurationLine |
getSourceLine()
Gets the source line.
|
boolean |
isUnique()
Returns whether the index is unique.
|
void |
parse(Entity entity,
ConfigurationLine line)
Parses a configuration line.
|
void |
setComment(String comment) |
void |
setFilterCondition(String filterCondition) |
void |
setName(String name) |
void |
setSourceLine(ConfigurationLine sourceLine) |
void |
setUnique(boolean unique) |
String |
sqlCreateIndex(Backend backend,
Entity entity)
Creates the index creation sql code.
|
String |
toString() |
void |
validate()
Validates the index.
|
public IndexImpl(EntityFactoryImpl factory, Entity entity, SourceInfo sourceInfo)
factory - the factory to create indexesentity - the entity this index belongs tosourceInfo - the source infopublic Entity getEntity()
Indexpublic void parse(Entity entity, ConfigurationLine line) throws ModelException
entity - the entityline - the source lineModelException - if parsing the model failedpublic String getName(Entity entity)
Indexpublic String getComment()
IndexgetComment in interface Indexpublic boolean isUnique()
Indexpublic String getFilterCondition()
IndexgetFilterCondition in interface Indexpublic List<IndexAttribute> getAttributes()
IndexgetAttributes in interface Indexpublic void setName(String name)
public void setComment(String comment)
public void setUnique(boolean unique)
public void setFilterCondition(String filterCondition)
public void validate()
throws ModelException
Indexvalidate in interface IndexModelException - if validation failedpublic ConfigurationLine getSourceLine()
IndexgetSourceLine in interface Indexpublic void setSourceLine(ConfigurationLine sourceLine)
public ModelException createModelException(String message)
Refers to the source line if set, otherwise just the message.
message - the messagepublic String sqlCreateIndex(Backend backend, Entity entity)
IndexsqlCreateIndex in interface Indexbackend - the backend to create sql code forentity - the entity to create the index forCopyright © 2016 Krake Softwaretechnik. All rights reserved.