com.mysema.query
Interface Projectable

All Known Subinterfaces:
ColQuery, HQLQuery, JDOQLQuery, SQLQuery
All Known Implementing Classes:
AbstractColQuery, AbstractHibernateQuery, AbstractJDOQLQuery, AbstractJPAQuery, AbstractSQLQuery, AbstractSQLQuery, ColQueryImpl, HibernateQuery, HibernateSQLQuery, HQLQueryBase, JDOQLQueryImpl, JPAQuery, JPASQLQuery, OracleQuery, ProjectableAdapter, ProjectableQuery, SQLQueryImpl

public interface Projectable

Projectable defines default projection methods for Query implementations. All Querydsl query implementations should implement either this interface or SimpleProjectable.

Author:
tiwe
See Also:
SimpleProjectable

Method Summary
 long count()
          return the amount of matched rows
 long countDistinct()
          return the amount of distinct matched rows
 com.mysema.commons.lang.CloseableIterator<Object[]> iterate(Expr<?>[] args)
          iterate over the results for the given projection
 com.mysema.commons.lang.CloseableIterator<Object[]> iterate(Expr<?> first, Expr<?> second, Expr<?>... rest)
          iterate over the results for the given projection
<RT> com.mysema.commons.lang.CloseableIterator<RT>
iterate(Expr<RT> projection)
          iterate over the results for the given projection
 com.mysema.commons.lang.CloseableIterator<Object[]> iterateDistinct(Expr<?>[] args)
          iterate over the distinct results for the given projection
 com.mysema.commons.lang.CloseableIterator<Object[]> iterateDistinct(Expr<?> first, Expr<?> second, Expr<?>... rest)
          iterate over the distinct results for the given projection
<RT> com.mysema.commons.lang.CloseableIterator<RT>
iterateDistinct(Expr<RT> projection)
          iterate over the distinct results for the given projection
 List<Object[]> list(Expr<?>[] args)
          list the results for the given projection
 List<Object[]> list(Expr<?> first, Expr<?> second, Expr<?>... rest)
          list the results for the given projection
<RT> List<RT>
list(Expr<RT> projection)
          list the results for the given projection
 List<Object[]> listDistinct(Expr<?>[] args)
          list the distinct results for the given projection
 List<Object[]> listDistinct(Expr<?> first, Expr<?> second, Expr<?>... rest)
          list the distinct results for the given projection
<RT> List<RT>
listDistinct(Expr<RT> projection)
          list the distinct results for the given projection
<RT> SearchResults<RT>
listDistinctResults(Expr<RT> projection)
          list the distinct results for the given projection
<RT> SearchResults<RT>
listResults(Expr<RT> projection)
          list the results for the given projection
<K,V> Map<K,V>
map(Expr<K> key, Expr<V> value)
          return the given projection as a Map instance using key and value for Map population
 Object[] uniqueResult(Expr<?>[] args)
          return a unique result for the given projection
 Object[] uniqueResult(Expr<?> first, Expr<?> second, Expr<?>... rest)
          return a unique result for the given projection
<RT> RT
uniqueResult(Expr<RT> projection)
          return a unique result for the given projection
 

Method Detail

count

@Nonnegative
long count()
return the amount of matched rows


countDistinct

@Nonnegative
long countDistinct()
return the amount of distinct matched rows


iterate

com.mysema.commons.lang.CloseableIterator<Object[]> iterate(Expr<?> first,
                                                            Expr<?> second,
                                                            Expr<?>... rest)
iterate over the results for the given projection

Parameters:
first -
second -
rest -
Returns:
an Iterator over the projection

iterate

com.mysema.commons.lang.CloseableIterator<Object[]> iterate(Expr<?>[] args)
iterate over the results for the given projection

Parameters:
args -
Returns:

iterate

<RT> com.mysema.commons.lang.CloseableIterator<RT> iterate(Expr<RT> projection)
iterate over the results for the given projection

Type Parameters:
RT - generic type of the Iteratpr
Parameters:
projection -
Returns:
an Iterator over the projection

iterateDistinct

com.mysema.commons.lang.CloseableIterator<Object[]> iterateDistinct(Expr<?> first,
                                                                    Expr<?> second,
                                                                    Expr<?>... rest)
iterate over the distinct results for the given projection

Parameters:
first -
second -
rest -
Returns:
an Iterator over the projection

iterateDistinct

com.mysema.commons.lang.CloseableIterator<Object[]> iterateDistinct(Expr<?>[] args)
iterate over the distinct results for the given projection

Parameters:
args -
Returns:

iterateDistinct

<RT> com.mysema.commons.lang.CloseableIterator<RT> iterateDistinct(Expr<RT> projection)
iterate over the distinct results for the given projection

Type Parameters:
RT - generic type of the Iteratpr
Parameters:
projection -
Returns:
an Iterator over the projection

list

List<Object[]> list(Expr<?> first,
                    Expr<?> second,
                    Expr<?>... rest)
list the results for the given projection

Parameters:
first -
second -
rest - rest
Returns:
a List over the projection

list

List<Object[]> list(Expr<?>[] args)
list the results for the given projection

Parameters:
args -
Returns:

list

<RT> List<RT> list(Expr<RT> projection)
list the results for the given projection

Type Parameters:
RT - generic type of the List
Parameters:
projection -
Returns:
a List over the projection

listDistinct

List<Object[]> listDistinct(Expr<?> first,
                            Expr<?> second,
                            Expr<?>... rest)
list the distinct results for the given projection

Parameters:
first -
second -
rest - rest
Returns:
a List over the projection

listDistinct

List<Object[]> listDistinct(Expr<?>[] args)
list the distinct results for the given projection

Parameters:
args -
Returns:

listDistinct

<RT> List<RT> listDistinct(Expr<RT> projection)
list the distinct results for the given projection

Type Parameters:
RT - generic type of the List
Parameters:
projection -
Returns:
a List over the projection

listResults

<RT> SearchResults<RT> listResults(Expr<RT> projection)
list the results for the given projection

Type Parameters:
RT -
Parameters:
projection -
Returns:

listDistinctResults

<RT> SearchResults<RT> listDistinctResults(Expr<RT> projection)
list the distinct results for the given projection

Type Parameters:
RT -
Parameters:
projection -
Returns:

map

<K,V> Map<K,V> map(Expr<K> key,
                   Expr<V> value)
return the given projection as a Map instance using key and value for Map population

Type Parameters:
K -
V -
Parameters:
key -
value -
Returns:

uniqueResult

@Nullable
Object[] uniqueResult(Expr<?> first,
                               Expr<?> second,
                               Expr<?>... rest)
return a unique result for the given projection

Parameters:
first -
second -
rest -
Returns:

uniqueResult

@Nullable
Object[] uniqueResult(Expr<?>[] args)
return a unique result for the given projection

Parameters:
args -
Returns:

uniqueResult

@Nullable
<RT> RT uniqueResult(Expr<RT> projection)
return a unique result for the given projection

Type Parameters:
RT - return type
Parameters:
projection -
Returns:
the result or null for an empty result


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