|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.entity.SelectQueryImpl.ExecutionContextImpl<E>
public final class SelectQueryImpl.ExecutionContextImpl<E>
Constructor Summary | |
---|---|
SelectQueryImpl.ExecutionContextImpl(OfBizDelegator ofBizDelegator,
EntityBuilder<E> entityBuilder)
|
Method Summary | ||
---|---|---|
List<E> |
asList()
Returns the selected values in a list. |
|
|
asList(Function<E,R> mappingFunction)
Returns the selected values in a list with the mapping function applied to each of them. |
|
|
consumeWith(EntityListConsumer<E,R> consumer)
Apply an EntityListConsumer to the returned results. |
|
long |
count()
Returns a count of matching items. |
|
E |
singleValue()
Returns the single Entity that is the result of this query. |
|
String |
toString()
|
|
void |
visitWith(Visitor<E> visitor)
Visits each entity returned by the query. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SelectQueryImpl.ExecutionContextImpl(OfBizDelegator ofBizDelegator, EntityBuilder<E> entityBuilder)
Method Detail |
---|
@Nonnull public List<E> asList()
SelectQuery.ExecutionContext
asList
in interface SelectQuery.ExecutionContext<E>
@Nonnull public <R> List<R> asList(@Nonnull Function<E,R> mappingFunction)
SelectQuery.ExecutionContext
mappingFunction
is a Function<GenericValue,String>
, then each value is returned
as the String
produced by the function instead of the GenericValue
itself.
asList
in interface SelectQuery.ExecutionContext<E>
R
- the type of value returned by the mapping function
@Nullable public E singleValue() throws IllegalStateException
SelectQuery.ExecutionContext
Will return null
if no rows were returned by the DB query.
singleValue
in interface SelectQuery.ExecutionContext<E>
null
if no match is found.
IllegalStateException
- if more than one row is found.public <R> R consumeWith(@Nonnull EntityListConsumer<E,R> consumer)
SelectQuery.ExecutionContext
EntityListConsumer
to the returned results.
This is equivalent to calling SelectQuery.ExecutionContext.visitWith(Visitor)
, except that the entity list consumer can
return a value.
consumeWith
in interface SelectQuery.ExecutionContext<E>
R
- the return value of the consumerconsumer
- the entity list consumer that will consume the query results
EntityListConsumer.result()
method.public void visitWith(@Nonnull Visitor<E> visitor)
SelectQuery.ExecutionContext
This is equivalent to calling SelectQuery.ExecutionContext.consumeWith(EntityListConsumer)
and ignoring the return value.
visitWith
in interface SelectQuery.ExecutionContext<E>
visitor
- the visitor to call with each entity that the query returnspublic long count()
SelectQuery.ExecutionContext
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.
count
in interface SelectQuery.ExecutionContext<E>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |