|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujorm.orm.ao.IndexModelBuilder
org.ujorm.orm.ao.IndexModelOrderedBuilder
public class IndexModelOrderedBuilder
Database meta index model builder with a user ordered columns support.
Two columns of a database composite index can be ordered according a number
at the end of a index name separated by the character '#'.
Two index columns with the same order value are sorted according
to the natural order of the Keys in the Ujo class.
The default order value (with no number in the index name) is 10.
See the next example to create a composite index with two columns in a reverted order:
@Column(index = IDX_STATE_NOTE + "#30") public static final Key<XOrder, State> STATE = newKey(); @Column(index = IDX_STATE_NOTE + "#20") public static final Key<XOrder, Integer> COUNT = newKey();The builder class can be changed by the parameter
MetaParams.INDEX_MODEL_BUILDER.
MetaParams.INDEX_MODEL_BUILDER| Nested Class Summary | |
|---|---|
protected static class |
IndexModelOrderedBuilder.OrderedColumn
Container for the Index model with an order request |
| Field Summary | |
|---|---|
protected static Integer |
DEFAULT_ORDER
The default index column value is 10 |
| Fields inherited from class org.ujorm.orm.ao.IndexModelBuilder |
|---|
mapIndex, metaTable, nameProvider |
| Constructor Summary | |
|---|---|
IndexModelOrderedBuilder()
|
|
| Method Summary | |
|---|---|
protected void |
addIndex(String indexName,
MetaColumn column,
boolean unique)
Add the column model to the column model from the IndexMap according the column name (case insensitive) |
protected void |
addToResult(List<IndexModelOrderedBuilder.OrderedColumn> columns,
boolean unique,
List<MetaIndex> result)
Add the column to the result index list |
Collection<MetaIndex> |
getIndexModels()
Returns all indexes of the current table |
protected char |
getOrderSerparator()
Returns a separator of the column order from an index name. |
| Methods inherited from class org.ujorm.orm.ao.IndexModelBuilder |
|---|
addColumnsToIndex, init, isExtendedIndexStrategy |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Integer DEFAULT_ORDER
| Constructor Detail |
|---|
public IndexModelOrderedBuilder()
| Method Detail |
|---|
protected char getOrderSerparator()
'#'DEFAULT_ORDER
protected void addIndex(String indexName,
MetaColumn column,
boolean unique)
addIndex in class IndexModelBuilderindexName - Case sensitive column namecolumn - Column modelunique - Unique column requestpublic Collection<MetaIndex> getIndexModels()
getIndexModels in class IndexModelBuilder
protected void addToResult(List<IndexModelOrderedBuilder.OrderedColumn> columns,
boolean unique,
List<MetaIndex> result)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||