com.atlassian.jira.entity.SelectQuery.ExecutionContext<E> |
![]() |
The parser context for entity engine Select
queries that is available after calling
runWith(EntityEngine)
or
runWith(com.atlassian.jira.ofbiz.OfBizDelegator)
.
The methods available through the execution context specify how the selected entities should be returned
to the caller. For example, asList()
will return a list of values, or count()
will return
only a count of them.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the selected values in a list with the mapping function applied to each of them.
| |||||||||||
Returns the selected values in a list.
| |||||||||||
Returns the selected values in a map with the mapping functions applies to each of them.
| |||||||||||
Apply an
EntityListConsumer to the returned results. | |||||||||||
Returns a count of matching items.
| |||||||||||
Performs the given action for each entity returned by the query.
| |||||||||||
Returns the single Entity that is the result of this query.
| |||||||||||
Visits each entity returned by the query.
|
Returns the selected values in a list with the mapping function applied to each of them. For example,
if mappingFunction
is a Function<GenericValue,String>
, then each value is returned
as the String
produced by the function instead of the GenericValue
itself.
Returns the selected values in a list.
Returns the selected values in a map with the mapping functions applies to each of them. For example,
if keyMapper
is a Function<GenericValue,Long>
, and valueMapper
is a
Function<GenericValue,String>
, then the returned map is of type Map<Long,String>
.
If the same key is returned by the keyMapper
more than once, the last value wins.
The functions are permitted to return null
.
keyMapper | the function that maps the queries values to the returned map's keys |
---|---|
valueMapper | the function that maps the queries values to the returned map's values |
Apply an EntityListConsumer
to the returned results.
This is equivalent to calling visitWith(Visitor)
, except that the entity list consumer can
return a value.
consumer | the entity list consumer that will consume the query results |
---|
result()
method.
Returns a count of matching items. Note that this does not go through the
the entityName + "Count"
pseudo-view stuff in the entity model, but rather generates
a count function directly in the query that it executes, so you should be able to use it with
arbitrary entities.
Performs the given action for each entity returned by the query.
This is morally equivalent to visitWith(Visitor)
, but is more consistent with the naming
conventions of the Java 8 streaming interfaces.
action | the action to be performed |
---|
Returns the single Entity that is the result of this query.
Will return null
if no rows were returned by the DB query.
null
if no match is found.IllegalStateException | if more than one row is found. |
---|
Visits each entity returned by the query.
visitor | the visitor to call with each entity that the query returns |
---|