com.mysema.query.support
Class SimpleQueryAdapter<T>

java.lang.Object
  extended by com.mysema.query.support.SimpleQueryAdapter<T>
Type Parameters:
T -
All Implemented Interfaces:
SimpleProjectable<T>, SimpleQuery<SimpleQueryAdapter<T>>

public class SimpleQueryAdapter<T>
extends Object
implements SimpleQuery<SimpleQueryAdapter<T>>, SimpleProjectable<T>

SimpleQueryAdapter is an apdater implementation for the SimpleQuery and SimpleProjectabl interfaces

Author:
tiwe

Constructor Summary
SimpleQueryAdapter(Q query, Expr<T> projection)
           
SimpleQueryAdapter(Query<?> query, Projectable projectable, Expr<T> projection)
           
 
Method Summary
 long count()
          Get the count of matched elements
 long countDistinct()
          Get the count of distinct matched elements
 SimpleQueryAdapter<T> limit(long limit)
          Defines the limit / max results for the query results
 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
 SimpleQueryAdapter<T> offset(long offset)
          Defines the offset for the query results
 SimpleQueryAdapter<T> orderBy(OrderSpecifier<?>... o)
          Defines the order expressions
 SimpleQueryAdapter<T> restrict(QueryModifiers modifiers)
          Defines both limit and offset of the query results
<P> SimpleQueryAdapter<T>
set(Param<P> param, P value)
          Set the given parameter to the given value
 String toString()
           
 T uniqueResult()
          Get the projection as a unique result
 SimpleQueryAdapter<T> where(EBoolean... e)
          Defines the filter constraints
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleQueryAdapter

public SimpleQueryAdapter(Q query,
                          Expr<T> projection)

SimpleQueryAdapter

public SimpleQueryAdapter(Query<?> query,
                          Projectable projectable,
                          Expr<T> projection)
Method Detail

count

public long count()
Description copied from interface: SimpleProjectable
Get the count of matched elements

Specified by:
count in interface SimpleProjectable<T>
Returns:

countDistinct

public long countDistinct()
Description copied from interface: SimpleProjectable
Get the count of distinct matched elements

Specified by:
countDistinct in interface SimpleProjectable<T>
Returns:

limit

public SimpleQueryAdapter<T> limit(long limit)
Description copied from interface: SimpleQuery
Defines the limit / max results for the query results

Specified by:
limit in interface SimpleQuery<SimpleQueryAdapter<T>>
Returns:

list

public List<T> list()
Description copied from interface: SimpleProjectable
Get the projection as a typed List

Specified by:
list in interface SimpleProjectable<T>
Returns:

listDistinct

public List<T> listDistinct()
Description copied from interface: SimpleProjectable
Get the projection as a typed List with distinct elements

Specified by:
listDistinct in interface SimpleProjectable<T>
Returns:

listDistinctResults

public SearchResults<T> listDistinctResults()
Description copied from interface: SimpleProjectable
Get the projection in SearchResults form with distinct element

Specified by:
listDistinctResults in interface SimpleProjectable<T>
Returns:

listResults

public SearchResults<T> listResults()
Description copied from interface: SimpleProjectable
Get the projection in SearchResults form

Specified by:
listResults in interface SimpleProjectable<T>
Returns:

offset

public SimpleQueryAdapter<T> offset(long offset)
Description copied from interface: SimpleQuery
Defines the offset for the query results

Specified by:
offset in interface SimpleQuery<SimpleQueryAdapter<T>>
Returns:

orderBy

public SimpleQueryAdapter<T> orderBy(OrderSpecifier<?>... o)
Description copied from interface: SimpleQuery
Defines the order expressions

Specified by:
orderBy in interface SimpleQuery<SimpleQueryAdapter<T>>
Returns:

restrict

public SimpleQueryAdapter<T> restrict(QueryModifiers modifiers)
Description copied from interface: SimpleQuery
Defines both limit and offset of the query results

Specified by:
restrict in interface SimpleQuery<SimpleQueryAdapter<T>>
Returns:

set

public <P> SimpleQueryAdapter<T> set(Param<P> param,
                                     P value)
Description copied from interface: SimpleQuery
Set the given parameter to the given value

Specified by:
set in interface SimpleQuery<SimpleQueryAdapter<T>>
Returns:

toString

public String toString()
Overrides:
toString in class Object

uniqueResult

public T uniqueResult()
Description copied from interface: SimpleProjectable
Get the projection as a unique result

Specified by:
uniqueResult in interface SimpleProjectable<T>
Returns:

where

public SimpleQueryAdapter<T> where(EBoolean... e)
Description copied from interface: SimpleQuery
Defines the filter constraints

Specified by:
where in interface SimpleQuery<SimpleQueryAdapter<T>>
Returns:


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