com.mysema.query.support
Class ProjectableQuery<Q extends ProjectableQuery<Q>>

java.lang.Object
  extended by com.mysema.query.support.QueryBase<Q>
      extended by com.mysema.query.support.ProjectableQuery<Q>
All Implemented Interfaces:
Projectable
Direct Known Subclasses:
AbstractColQuery, AbstractJDOQLQuery, AbstractSQLQuery, AbstractSQLQuery, AbstractSQLQuery, HQLQueryBase

public abstract class ProjectableQuery<Q extends ProjectableQuery<Q>>
extends QueryBase<Q>
implements Projectable

ProjectableQuery extends the QueryBase class to provide default implementations of the methods of the Projectable interface

Version:
$Id$
Author:
tiwe

Field Summary
 
Fields inherited from class com.mysema.query.support.QueryBase
queryMixin
 
Constructor Summary
ProjectableQuery(QueryMixin<Q> queryMixin)
           
 
Method Summary
 long countDistinct()
          return the amount of distinct matched rows
 com.mysema.commons.lang.CloseableIterator<Object[]> iterate(Expr<?> first, Expr<?> second, Expr<?>... rest)
          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
<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> expr)
          return a unique result for the given projection
 
Methods inherited from class com.mysema.query.support.QueryBase
groupBy, having, limit, offset, orderBy, restrict, set, toString, where
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.mysema.query.Projectable
count, iterate, iterate, listResults
 

Constructor Detail

ProjectableQuery

public ProjectableQuery(QueryMixin<Q> queryMixin)
Method Detail

countDistinct

public long countDistinct()
Description copied from interface: Projectable
return the amount of distinct matched rows

Specified by:
countDistinct in interface Projectable

iterate

public final com.mysema.commons.lang.CloseableIterator<Object[]> iterate(Expr<?> first,
                                                                         Expr<?> second,
                                                                         Expr<?>... rest)
Description copied from interface: Projectable
iterate over the results for the given projection

Specified by:
iterate in interface Projectable
Returns:
an Iterator over the projection

iterateDistinct

public final com.mysema.commons.lang.CloseableIterator<Object[]> iterateDistinct(Expr<?> first,
                                                                                 Expr<?> second,
                                                                                 Expr<?>... rest)
Description copied from interface: Projectable
iterate over the distinct results for the given projection

Specified by:
iterateDistinct in interface Projectable
Returns:
an Iterator over the projection

iterateDistinct

public final com.mysema.commons.lang.CloseableIterator<Object[]> iterateDistinct(Expr<?>[] args)
Description copied from interface: Projectable
iterate over the distinct results for the given projection

Specified by:
iterateDistinct in interface Projectable
Returns:

iterateDistinct

public final <RT> com.mysema.commons.lang.CloseableIterator<RT> iterateDistinct(Expr<RT> projection)
Description copied from interface: Projectable
iterate over the distinct results for the given projection

Specified by:
iterateDistinct in interface Projectable
Type Parameters:
RT - generic type of the Iteratpr
Returns:
an Iterator over the projection

list

public final List<Object[]> list(Expr<?> first,
                                 Expr<?> second,
                                 Expr<?>... rest)
Description copied from interface: Projectable
list the results for the given projection

Specified by:
list in interface Projectable
rest - rest
Returns:
a List over the projection

list

public List<Object[]> list(Expr<?>[] args)
Description copied from interface: Projectable
list the results for the given projection

Specified by:
list in interface Projectable
Returns:

list

public <RT> List<RT> list(Expr<RT> projection)
Description copied from interface: Projectable
list the results for the given projection

Specified by:
list in interface Projectable
Type Parameters:
RT - generic type of the List
Returns:
a List over the projection

listDistinct

public final List<Object[]> listDistinct(Expr<?> first,
                                         Expr<?> second,
                                         Expr<?>... rest)
Description copied from interface: Projectable
list the distinct results for the given projection

Specified by:
listDistinct in interface Projectable
rest - rest
Returns:
a List over the projection

listDistinct

public final List<Object[]> listDistinct(Expr<?>[] args)
Description copied from interface: Projectable
list the distinct results for the given projection

Specified by:
listDistinct in interface Projectable
Returns:

listDistinct

public final <RT> List<RT> listDistinct(Expr<RT> projection)
Description copied from interface: Projectable
list the distinct results for the given projection

Specified by:
listDistinct in interface Projectable
Type Parameters:
RT - generic type of the List
Returns:
a List over the projection

listDistinctResults

public final <RT> SearchResults<RT> listDistinctResults(Expr<RT> projection)
Description copied from interface: Projectable
list the distinct results for the given projection

Specified by:
listDistinctResults in interface Projectable
Returns:

map

public final <K,V> Map<K,V> map(Expr<K> key,
                                Expr<V> value)
Description copied from interface: Projectable
return the given projection as a Map instance using key and value for Map population

Specified by:
map in interface Projectable
Returns:

uniqueResult

public final Object[] uniqueResult(Expr<?> first,
                                   Expr<?> second,
                                   Expr<?>... rest)
Description copied from interface: Projectable
return a unique result for the given projection

Specified by:
uniqueResult in interface Projectable
Returns:

uniqueResult

public Object[] uniqueResult(Expr<?>[] args)
Description copied from interface: Projectable
return a unique result for the given projection

Specified by:
uniqueResult in interface Projectable
Returns:

uniqueResult

public <RT> RT uniqueResult(Expr<RT> expr)
Description copied from interface: Projectable
return a unique result for the given projection

Specified by:
uniqueResult in interface Projectable
Type Parameters:
RT - return type
Returns:
the result or null for an empty result


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