com.atlassian.jira.entity
Interface SelectQuery.ExecutionContext<E>

All Known Implementing Classes:
SelectQueryImpl.ExecutionContextImpl
Enclosing interface:
SelectQuery<E>

public static interface SelectQuery.ExecutionContext<E>


Method Summary
 List<E> asList()
           
<R> R
consumeWith(EntityListConsumer<E,R> consumer)
           
 long count()
          Returns a count of matching items.
 E singleValue()
          Returns the single Entity that is the result of this query.
 void visitWith(Visitor<E> visitor)
           
 

Method Detail

asList

List<E> asList()

singleValue

E singleValue()
              throws IllegalStateException
Returns the single Entity that is the result of this query.

Will return null if no rows were returned by the DB query. Throws IllegalStateException if more than one row is found.

Returns:
the Entity found or null of none found.
Throws:
IllegalStateException - if more than one row is found.

consumeWith

<R> R consumeWith(EntityListConsumer<E,R> consumer)

visitWith

void visitWith(Visitor<E> visitor)

count

long count()
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.

Returns:
count of matching items
Since:
6.1


Copyright © 2002-2014 Atlassian. All Rights Reserved.