com.mysema.query
Interface SimpleProjectable<T>

All Known Implementing Classes:
AbstractLuceneQuery, LuceneQuery, MongodbQuery, MorphiaQuery, SearchQuery, SimpleProjectableAdapter, SimpleQueryAdapter, TypedQuery

public interface SimpleProjectable<T>

SimpleProjectable defines a simpler projection interface than Projectable.

Author:
tiwe
See Also:
Projectable

Method Summary
 long count()
          Get the count of matched elements
 long countDistinct()
          Get the count of distinct matched elements
 boolean exists()
           
 com.mysema.commons.lang.CloseableIterator<T> iterate()
          Get the projection as a typed closeable Iterator
 com.mysema.commons.lang.CloseableIterator<T> iterateDistinct()
          Get the projection as a typed closeable Iterator with distinct elements
 List<T> list()
          Get the projection as a typed List
 List<T> listDistinct()
          Get the projection as a typed List with distinct elements
 SearchResults<T> listDistinctResults()
          Get the projection in SearchResults form with distinct element
 SearchResults<T> listResults()
          Get the projection in SearchResults form
 boolean notExists()
           
 T singleResult()
          Get the projection as a single result or null if no result is found
 T uniqueResult()
          Get the projection as a unique result or null if no result is found
 

Method Detail

exists

boolean exists()
Returns:
true, if rows matching the given criteria exist, otherwise false

notExists

boolean notExists()
Returns:
true, if no rows matching the given criteria exist, otherwise false

iterate

com.mysema.commons.lang.CloseableIterator<T> iterate()
Get the projection as a typed closeable Iterator

Returns:

iterateDistinct

com.mysema.commons.lang.CloseableIterator<T> iterateDistinct()
Get the projection as a typed closeable Iterator with distinct elements

Returns:

list

List<T> list()
Get the projection as a typed List

Returns:

listDistinct

List<T> listDistinct()
Get the projection as a typed List with distinct elements

Returns:

singleResult

@Nullable
T singleResult()
Get the projection as a single result or null if no result is found

for multiple results only the first one is returned

Returns:

uniqueResult

@Nullable
T uniqueResult()
Get the projection as a unique result or null if no result is found

Returns:
Throws:
NonUniqueResultException - if there is more than one matching result

listResults

SearchResults<T> listResults()
Get the projection in SearchResults form

Returns:

listDistinctResults

SearchResults<T> listDistinctResults()
Get the projection in SearchResults form with distinct element

Returns:

count

long count()
Get the count of matched elements

Returns:

countDistinct

long countDistinct()
Get the count of distinct matched elements

Returns:


Copyright © 2007-2012 Mysema Ltd. All Rights Reserved.