It is strongly recommended to call close()
on the returned SeekableIterator
if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources.
null
in case no matching custom object instance could be found.
null
in case no matching custom object instance could be found.
custom.color = {1}
),
while for system attributes no prefix is used (e.g. name = {4}
).
Supported attribute value types with sample expression values:'String', 'Str*', 'Strin?'
1, 3E4
1.0, 3.99E5
yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)
yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00
true, false
'[email protected]', '*@demandware.com'
'String', 'Str*', 'Strin?'
1, 3E4
1.0, 3.99E5
'String', 'Str*', 'Strin?'
1, 3E4
=
Equals - All types; supports NULL value (thumbnail = NULL
)!=
Not equals - All types; supports NULL value (thumbnail != NULL
)<
Less than - Integer, Number and Date types only>
Greater than - Integer, Number and Date types only<=
Less or equals than - Integer, Number and Date types only>=
Greater or equals than - Integer, Number and Date types onlyLIKE
Like - String types and Email only; use if leading or trailing
wildcards will be used to support substring search(custom.country LIKE 'US*'
)ILIKE
Caseindependent Like - String types and Email only, use to support
case insensitive query (custom.country ILIKE 'usa'
), does also support wildcards for
substring matchinggender = {1} AND (age >= {2} OR (NOT profession LIKE {3}))
.
The query language provides a placeholder syntax to pass objects as
additional search parameters. Each passed object is related to a
placeholder in the query string. The placeholder must be an Integer that
is surrounded by braces. The first Integer value must be '0', the second
'1' and so on, e.g.
querySystemObjects("sample", "age = {0} or creationDate >= {1}", 18, date)
If there is more than one object matching the specified query criteria, the
result is not deterministic. In order to retrieve a single object from a sorted result
set it is recommended to use the following code:
queryCustomObjects("", "custom.myAttr asc", null).first()
.
The method first()
returns only the next element and closes the
iterator.type
which was found when executing the queryString
.
custom.color = {1}
),
while for system attributes no prefix is used (e.g. name = {4}
).
Supported attribute value types with sample expression values:'String', 'Str*', 'Strin?'
1, 3E4
1.0, 3.99E5
yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)
yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00
true, false
'[email protected]', '*@demandware.com'
'String', 'Str*', 'Strin?'
1, 3E4
1.0, 3.99E5
'String', 'Str*', 'Strin?'
1, 3E4
=
Equals - All types; supports NULL value (thumbnail = NULL
)!=
Not equals - All types; supports NULL value (thumbnail != NULL
)<
Less than - Integer, Number and Date types only>
Greater than - Integer, Number and Date types only<=
Less or equals than - Integer, Number and Date types only>=
Greater or equals than - Integer, Number and Date types onlyLIKE
Like - String types and Email only; use if leading or trailing
wildcards will be used to support substring search(custom.country LIKE 'US*'
)ILIKE
Caseindependent Like - String types and Email only, use to support
case insensitive query (custom.country ILIKE 'usa'
), does also support wildcards for
substring matchinggender = {1} AND (age >= {2} OR (NOT profession LIKE {3}))
.
The query language provides a placeholder syntax to pass objects as
additional search parameters. Each passed object is related to a
placeholder in the query string. The placeholder must be an Integer that
is surrounded by braces. The first Integer value must be '0', the second
'1' and so on, e.g.
querySystemObjects("sample", "age = {0} or creationDate >= {1}", 18, date)
The sorting parameter is optional and may contain a comma separated list of
attribute names to sort by. Each sort attribute name may be followed by an
optional sort direction specifier ('asc' | 'desc'). Default sorting directions is
ascending, if no direction was specified.age desc, name
queryCustomObjects("sample", "", "custom.myAttr asc")
It is strongly recommended to call close()
on the returned SeekableIterator
if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources.
"name like 'tom*' and age = 66"
The identifier for an attribute to use in a query condition is always the
ID of the attribute as defined in the type definition. For custom defined attributes
the prefix custom is required in the search term (e.g. custom.color = {1}
),
while for system attributes no prefix is used (e.g. name = {4}
).
Supported attribute value types with sample expression values:'String', 'Str*', 'Strin?'
1, 3E4
1.0, 3.99E5
yyyy-MM-dd e.g. 2007-05-31 (Default TimeZone = UTC)
yyyy-MM-dd'T'hh:mm:ss+Z e.g. 2007-05-31T00:00+Z (Z TimeZone = UTC) or 2007-05-31T00:00:00
true, false
'[email protected]', '*@demandware.com'
'String', 'Str*', 'Strin?'
1, 3E4
1.0, 3.99E5
'String', 'Str*', 'Strin?'
1, 3E4
age desc, name
It is strongly recommended to call close()
on the returned SeekableIterator
if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources.