public class IndexModelOrderedBuilder extends IndexModelBuilder
'#'.
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.
private static final String IDX_STATE_COUNT = "idx_state_count"; @Column(index = IDX_STATE_COUNT + "#30") public static final Key<XOrder, State> STATE = newKey(); @Column(index = IDX_STATE_COUNT + "#20") public static final Key<XOrder, Integer> COUNT = newKey();The builder class can be changed by the parameter
MetaParams.INDEX_MODEL_BUILDER
in time of building a meta-model according the next example:
MetaParams params = new MetaParams(); params.set(MetaParams.INDEX_MODEL_BUILDER, IndexModelOrderedBuilder.class); ormHandler.config(params);
MetaParams.INDEX_MODEL_BUILDER| Modifier and Type | Class and Description |
|---|---|
protected static class |
IndexModelOrderedBuilder.OrderedColumn
Container for the Index model with an order request
|
| Modifier and Type | Field and Description |
|---|---|
protected static Integer |
DEFAULT_ORDER
The default index column value is 10
|
mapIndex, metaTable, nameProvider| Constructor and Description |
|---|
IndexModelOrderedBuilder() |
| Modifier and Type | Method and Description |
|---|---|
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,
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.
|
addColumnsToIndex, init, isExtendedIndexStrategyprotected static final Integer DEFAULT_ORDER
protected char getOrderSerparator()
'#'DEFAULT_ORDERprotected 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 IndexModelBuilderprotected void addToResult(List<IndexModelOrderedBuilder.OrderedColumn> columns, List<MetaIndex> result)
Copyright 2013, Pavel Ponec