Project: stp

com.ibm.rational.wvcm.stp.cq
Class CqQuery.ListOptionsClass

Object
  extended by CqQuery.ListOptionsClass
All Implemented Interfaces:
CqQuery.CommonOptions, CqQuery.ListOptions
Enclosing interface:
CqQuery

public static class CqQuery.ListOptionsClass
extends Object
implements CqQuery.ListOptions

Instances of this class provide the default values for each attribute specified by the ListOptions interface, which is the same behavior exhibited when using null for a ListOptions object. Clients can provide non-default attribute values by defining and instantiating a subclass of this class that overrides select methods to provide the desired non-default value.

Using a class instance creation expression, for example, one could define a ListOptions object for requesting row counts as follows...

     ListOptions COUNT_ROWS = new ListOptionsClass(){
         public Boolean getEnableRowCount() { return Boolean.TRUE; };
     };
 


Field Summary
 
Fields inherited from interface CqQuery.ListOptions
FULL_CONVERSION, NO_CONVERSION, NULL_CONVERSION
 
Constructor Summary
CqQuery.ListOptionsClass()
           
 
Method Summary
 Boolean getEnableRowCount()
          If TRUE, the total number of rows generated by the query will be computed by the sever and returned as the value of CqResultSet.getRowCount().
 Long getMaxMultiLineTextLength()
           
 PropertyRequestItem.PropertyRequest getQueryPropertyRequest()
           
 Long getRowNumberLimit()
           
 CqQuery.DisplayField[] getValueConversionData()
          Specifies how CqRowData is to interpret the string data for a row when computing the Object[] returned by CqRowData.getValues().
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CqQuery.ListOptionsClass

public CqQuery.ListOptionsClass()
Method Detail

getEnableRowCount

public Boolean getEnableRowCount()
Description copied from interface: CqQuery.ListOptions
If TRUE, the total number of rows generated by the query will be computed by the sever and returned as the value of CqResultSet.getRowCount(). All of these rows will be in the response only if maxRows is at least as great as the row count. If FALSE, no count is computed; CqResultSet.getRowCount() returns -1. In this latter case, if the number of elements in the response is equal to maxRows, there is no way to tell if there were more rows in the result set not returned by the response.

Specified by:
getEnableRowCount in interface CqQuery.ListOptions
Returns:
TRUE if doExeute/doQuery is to compute and return a count of the number of resources that match the filter (whether or not those resources are actually returned from the server); FALSE or null if only the maximum number of records are to be returned with no indication whether or not there might be more.

getMaxMultiLineTextLength

public Long getMaxMultiLineTextLength()
Specified by:
getMaxMultiLineTextLength in interface CqQuery.ListOptions
Returns:
The maximum number of characters that are to be included in each row of the response for each multi-line text display field. If null, the default limit established by the server will be applied.

getQueryPropertyRequest

public PropertyRequestItem.PropertyRequest getQueryPropertyRequest()
Specified by:
getQueryPropertyRequest in interface CqQuery.CommonOptions
Returns:
The properties of the query being executed that should be retrieved and returned with the result set. If null, CqResultSet().getQuery will return null; otherwise it will return a CqQuery proxy populated with the properties requested.
See Also:
CqResultSet.getQuery()

getRowNumberLimit

public Long getRowNumberLimit()
Specified by:
getRowNumberLimit in interface CqQuery.CommonOptions
Returns:
The largest row number that the query may return. This is the maximum number of rows allowed in the result set only if the targetRow parameter is 1. In general, the maximum number of rows returned by an execution of the query will be the smallest of
  • the maxRows parameter,
  • the value of 1+getRowNumberLimit()-targetRow, and
  • 1+CqResultSet.getRowNumberHardLimit()-targetRows
. If null, the value of CqResultSet.getRowNumberSoftLimit() will be used.
See Also:
CqResultSet.getRowNumberHardLimit(), CqResultSet.getRowNumberSoftLimit(), CqResultSet.isRowNumberLimitExceeded()

getValueConversionData

public CqQuery.DisplayField[] getValueConversionData()
Description copied from interface: CqQuery.ListOptions
Specifies how CqRowData is to interpret the string data for a row when computing the Object[] returned by CqRowData.getValues().

If this method returns the distinguished value NO_CONVERSION, the array returned by CqRowData.getValues() will be the same array of Strings returned by CqRowData.getStrings(); otherwise, getValues() will return an array of native Java objects obtained by converting the string image in each column to an object of the type specified for the column in the DisplayField[] returned by this option. (NULL_IMAGE Strings will be converted to null).

Enabling this conversion will require some extra overhead in executing the query since the type information must be collected for each column and that may require additional round-trips to the server if not already specified in the DisplayField[] returned by this option. Conversion to Java objects for a particular row is not attempted, however, until the getValues() method is invoked on that row.

The default behavior is to use the type information returned by CqResultSet.getColumnTypes() to perform the conversion when requested.

Another possible return is a non-empty DisplayField[], which is useful primarily when the query is SQL based. For a SQL-based query, the client must provide the detailed type information based on it's knowledge of the fields returned by the SQL statement it is using. An explicit DisplayField[] might also be returned to avoid an extra round-trip to the server to obtain the DISPLAY_FIELD information. The DisplayField[] used to define a query or used in the invocation of CqFieldDefinition.doQuery would always be a suitable return value, but lighter weight DisplayField[]s will often do as well.

If an explicit DisplayField[] is returned, the number of visible fields in the array must be the same as the number of items returned by CqRowData.getStrings(). Each visible DisplayField must define at least one of its Path, FieldType, Aggregation or Function attributes. The remaining attributes are ignored. If only the Path attribute is specified, the FieldType will be obtained from the last CqFieldDefinition of that Path (requesting that information from the server if necessary).

If the Aggregation attribute is COUNT, the other attributes are ignored and the column value is converted to an Integer.

If the Function attribute is not null and not NONE, the other attributes are ignored and the column value is converted to a Date object.

If the FieldType is RESOURCE or RESOURCE_LIST, the Path attribute must be specified so that the type of the resource referenced by that path can be determined. (The CqFieldDefintion.REFERENCED_RECORD_TYPE property is used for this purpose and will be obtained from the server if not defined by the last proxy in the Path.)

Specified by:
getValueConversionData in interface CqQuery.ListOptions
Returns:
NO_CONVERSION, NULL_CONVERSION, FULL_CONVERSION, or a DisplayField[] specifying a visible field for each value returned for a row.

Generated Thu 18-Feb-2010 12:40 PM

Copyright © IBM 2010. All rights reserved.