PropertyDefinition :: indexDefinition - Get index definition
The function returns the index definition for a collection property.
When the function is called with an invalid property definition or when the property does not provide an index definition, the function throws an exception.
... fragment ( Property &person ) {
PropertyDefinition pd(person.propertyDefinition());
int count = pd.indexCount();
while ( count-- )
Application::output(indexDefinition(count).name());
}
An index definition defines a sort order for a collection.
Implementation overview
- Get index definition by name
PropertyDefinition :: indexDefinition ( sKeyName ) - Get index definition at position
PropertyDefinition :: indexDefinition ( iPosition )
Implementation details
-
Get index definition by name
odaba::IndexDefinition PropertyDefinition  :: indexDefinition ( odaba::String &sKeyName )
The function returns the index definition with the key name passed in sKeyName. When no index with the passed key name could be located, the function throws an exception.
- sKeyName
- Key name
The key name must be the name of a key defined for the given structure. Thekey name is passed as string with maximum 40 characters.
In order to pass no key name, an empty string ( String() ) has to be passed.
to list
- sKeyName
- Key name
-
Get index definition at position
odaba::IndexDefinition PropertyDefinition  :: indexDefinition ( int32 iPosition )
The function returns the index definition at position passed in iPosition. When no index is available at requested position, the function throws an exception.
- iPosition
- Position in collection
The position of an element in a collection is beginning with 0 for the first element.
to list
- iPosition
- Position in collection