Class Criterion
This class is not meant to be created and used, it is actually documentation of settings
allowed in a DataSource descriptor (.ds.xml file), for use with Smart GWT Pro Edition and
above.
See com.smartgwt.client.docs.serverds
for how to use this documentation.
A criterion is part of the definition of an AdvancedCriteria
object, which is used to filter records
according to search criteria.
A criterion consists of an operator
and typically a fieldName
from a Record
and a value
to compare to. However some operators either don't require a value (eg, isNull) or act
on other criteria rather than directly on a Record
's fields
(eg, the "and" and "or" logical operators). Also, it is possible to specify a fieldQuery
instead of a
fieldName
and/or a valueQuery
instead of a value
A shortcut form is also allowed where only
fieldName
and value
values are provided. In this case the
operator
is assumed to be "equals".
-
Field Summary
Modifier and TypeFieldDescriptionFor a criterion with an operator that acts on other criteria (eg "and", "or"), a list of sub-criteria that are grouped together by the operator.End value of a criterion with an operator of type"valueRange"
.Name of the field in eachRecord
that this criterion applies to.A subquery to use instead of afieldName
.Operator this criterion applies.Start value of a criterion with an operator of type"valueRange"
.Value to be used in the application of this criterion.A subquery to use instead of avalue
. -
Constructor Summary
-
Method Summary
-
Field Details
-
operator
Operator this criterion applies.Default value is null
- See Also:
-
fieldName
Name of the field in eachRecord
that this criterion applies to. Not applicable for a criterion withsub-criteria
. Can be specified as a dataPath to allow matching nested objects. Use '/' as delimiters for dataPath. SeedataPath
for more information.fieldQuery
shortcutsfieldName
can also be used to express a compact form of related-field filtering. If you set this property to the qualified name of a field on a related DataSource, it will be transformed into a basicAdvancedCriterionSubquery
. For example, say you have anOrder
dataSource, which has aforeign key relation
to yourCustomer
dataSource, and yourCustomer
dataSource has a "region" field. If you wanted to fetch all Orders for Customers in the EMEA region, you could declare criteria like this:{fieldName: "Customer.region", operator: "equals", value: "EMEA"}
This would be transformed into a subquery filter that would select only the records you want:{ fieldQuery: { dataSource: "Customer", queryOutput: "region" }, operator: "equals", value: "EMEA" }
This transformation takes place before the filtering subsystem even sees the criteria, so declaring the shortcut form viafieldName
leads to exactly the same filtering behavior as if you specified the subquery directly as afieldQuery
See the
AdvancedCriterionSubquery
overview linked above for more details of the extremely powerful subquery filtering options.Default value is null
- See Also:
-
valueQuery
A subquery to use instead of avalue
. When you use avalueQuery
instead of avalue
, you are comparing the values in the record field named in the criterionfieldName
to the result of running a per-record subquery, rather than a literal scalar value. . Note, it is also possible to specify both avalueQuery
and afieldQuery
.See the
subquery overview
for more details of the criteria subquery feature, and examples of use.Note, if you specify both
valueQuery
andvalue
in a criterion, we use thevalue
and thevalueQuery
is ignoredDefault value is null
- See Also:
-
fieldQuery
A subquery to use instead of afieldName
. When you use afieldQuery
instead of afieldName
, you are comparing the criterionvalue
to the result of running a per-record subquery, rather than a field value found directly on the record. Note, it is also possible to specify both afieldQuery
and avalueQuery
.See the
subquery overview
for more details of the criteria subquery feature, and examples of use.Note, if you specify both
fieldQuery
andfieldName
in a criterion, we use thefieldName
and thefieldQuery
is ignored.Note also that
fieldName
supports a special shortcut syntax for declaring afieldQuery
as a simple qualified reference to a related field. See thefieldName
doc linked above for detailsDefault value is null
- See Also:
-
end
End value of a criterion with an operator of type"valueRange"
.Default value is null
- See Also:
-
start
Start value of a criterion with an operator of type"valueRange"
.Default value is null
- See Also:
-
criteria
For a criterion with an operator that acts on other criteria (eg "and", "or"), a list of sub-criteria that are grouped together by the operator.Default value is null
- See Also:
-
value
Value to be used in the application of this criterion.Value may be required or not required, or may be an Array, according to the
OperatorValueType
of the operator.Default value is null
- See Also:
-
-
Constructor Details
-
Criterion
public Criterion()
-