com.businessobjects.rebean.wi
Interface QuerySorts


public interface QuerySorts

Warning: This interface is no longer functional from the SAP BusinessObjects 4.0 release onwards.

QuerySorts is a collection of QuerySort objects.

Example:Applying query sorts:

 String sQuery = "SELECT SI_CUID, SI_NAME FROM"
         + " CI_APPOBJECTS WHERE SI_KIND ='"+ CeKind.UNIVERSE +"'";
 IInfoObjects universes = (IInfoObjects) iStore.query(sQuery);
 IInfoObject ceInfoobject = (IInfoObject)universes.get(31);
 String universeId =((IUniverse)ceInfoobject).buildUniverseIdString();
 DocumentInstance doc = repEng.newDocument(universeId);
 ReportContainer report = doc.createReport("Report1");
 DataProviders dps = doc.getDataProviders();
 // Retrieve the 1st data provider
 DataProvider dp = dps.getItem(0);
 // Retrieve the universe objects
 DataSource ds = dp.getDataSource();
 DataSourceObject country = ds.getClasses().getChildByName("Country");
 DataSourceObject revenue = ds.getClasses().getChildByName ("Revenue");
 Query q = dp.getQuery();
 // Add result objects to the query
 q.addResultObject(country);
 q.addResultObject(revenue);
 QuerySorts sorts = q.getQuerySorts();
 QuerySort sort = sorts.addQuerySort(revenue,SortType.DESCENDING);
 // Run the query and fetch the data
 dp.runQuery();
 //To obtain the sorted result, you must call getResultAsXML{} on DataProvider.
 CharacterView view = dp.getResultAsXML();
 out.print(view.getContent());
 

Since:
11.7

Method Summary
 QuerySort addQuerySort(DataSourceObject obj, SortType type)
          Adds a sort on the specified data source object.
 int getCount()
          Gets the number of sorts.
 QuerySort getQuerySort(int index)
          Gets the specified sort.
 QuerySort getQuerySortByID(java.lang.String dsObjId)
          Gets the QuerySort identified by it's data source object identifer.
 void moveQuerySort(int fromIndex, int toIndex)
          Swap two QuerySort objects at positions fromIndex and toIndex in the collection.
 void removeAll()
          Removes all sorts.
 void removeQuerySort(int index)
          Removes the specified sort.
 

Method Detail

getCount

int getCount()
Gets the number of sorts.

Returns:
the number of sorts.

getQuerySort

QuerySort getQuerySort(int index)
Gets the specified sort.

Parameters:
index - index of the sort to retrieve.
Returns:
the sort at the specified index.

getQuerySortByID

QuerySort getQuerySortByID(java.lang.String dsObjId)
Gets the QuerySort identified by it's data source object identifer.

Parameters:
dsObjId - data source object identifer
Returns:
QuerySort

removeQuerySort

void removeQuerySort(int index)
Removes the specified sort.

Parameters:
index - the index of the sort to delete

removeAll

void removeAll()
Removes all sorts.


addQuerySort

QuerySort addQuerySort(DataSourceObject obj,
                       SortType type)
Adds a sort on the specified data source object.

Parameters:
obj - the data source object
type - the sort type to applied
Returns:
QuerySort

moveQuerySort

void moveQuerySort(int fromIndex,
                   int toIndex)
Swap two QuerySort objects at positions fromIndex and toIndex in the collection.

Parameters:
fromIndex - position of one QuerySort to be swapped
toIndex - position of the other QuerySort to be swapped