|
Project: stp | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectCqQuery.ListOptionsClass
public static class CqQuery.ListOptionsClass
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 |
---|
public CqQuery.ListOptionsClass()
Method Detail |
---|
public Boolean getEnableRowCount()
CqQuery.ListOptions
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.
getEnableRowCount
in interface CqQuery.ListOptions
public Long getMaxMultiLineTextLength()
getMaxMultiLineTextLength
in interface CqQuery.ListOptions
public PropertyRequestItem.PropertyRequest getQueryPropertyRequest()
getQueryPropertyRequest
in interface CqQuery.CommonOptions
CqResultSet.getQuery()
public Long getRowNumberLimit()
getRowNumberLimit
in interface CqQuery.CommonOptions
targetRow
parameter is 1. In general,
the maximum number of rows returned by an execution of the
query will be the smallest of
maxRows
parameter,
1+getRowNumberLimit()-targetRow
, and
1+CqResultSet.getRowNumberHardLimit()-targetRows
CqResultSet.getRowNumberHardLimit()
,
CqResultSet.getRowNumberSoftLimit()
,
CqResultSet.isRowNumberLimitExceeded()
public CqQuery.DisplayField[] getValueConversionData()
CqQuery.ListOptions
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.)
getValueConversionData
in interface CqQuery.ListOptions
|
Generated Thu 23-May-2013 10:32 PM | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |