thenBy

open fun thenBy(value: QueryValue): DataQuery

See thenBy(QueryValue, SortOrder).

Return

(see linked method).

Parameters

value

Value parameter.


open fun thenBy(value: QueryValue, order: SortOrder): DataQuery

Add to {@link com.sap.cloud.mobile.kotlin.odata.DataQuery#sortItems DataQuery.sortItems} a value for result ordering. This function is an alias for {@link com.sap.cloud.mobile.kotlin.odata.DataQuery#orderBy(com.sap.cloud.mobile.kotlin.odata.QueryValue, com.sap.cloud.mobile.kotlin.odata.SortOrder) DataQuery.orderBy}. By convention to improve readability when multiple ordering values are required, the first ordering value is added using orderBy, and subsequent ordering values are added using thenBy.

Example using proxy classes:
open fun thenByExample(): kotlin.Unit
{
    val service = this.service;
    val query = DataQuery().orderBy(Artist.lastName).thenBy(Artist.firstName);
    val artists = service.getArtists(query);
    this.showArtists(artists);
}
Example using dynamic API:
open fun thenByExample(): kotlin.Unit
{
    val service = this.service;
    val artistsEntitySet = service.getEntitySet("Artists");
    val artistEntityType = artistsEntitySet.entityType;
    val lastNameProperty = artistEntityType.getProperty("lastName");
    val firstNameProperty = artistEntityType.getProperty("firstName");
    val query = DataQuery().from(artistsEntitySet).orderBy(lastNameProperty)
        .thenBy(firstNameProperty);
    val artists = service.executeQuery(query).getEntityList();
    this.showArtists(artists);
}

Return

This query.

Parameters

value

Value for ordering.

order

The sort order (defaults to ascending).