com.mysema.query.collections
Class AbstractColQuery<Q extends AbstractColQuery<Q>>

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

public abstract class AbstractColQuery<Q extends AbstractColQuery<Q>>
extends ProjectableQuery<Q>

AbstractColQuery provides a base class for Collection query implementations. Extend it like this

 public class MyType extends AbstractColQuery<MyType>{
   ...
 }
 

Author:
tiwe
See Also:
ColQuery

Field Summary
 
Fields inherited from class com.mysema.query.support.QueryBase
queryMixin
 
Constructor Summary
AbstractColQuery(QueryMetadata metadata, QueryEngine queryEngine)
           
 
Method Summary
<A> Q
bind(Path<A> entity, Iterable<? extends A> col)
           
 long count()
          return the amount of matched rows
 boolean exists()
           
<A> Q
from(Path<A> entity, Iterable<? extends A> col)
           
abstract  QueryMetadata getMetadata()
           
protected  QueryEngine getQueryEngine()
           
<P> Q
innerJoin(CollectionExpression<?,P> target, Path<P> alias)
           
<P> Q
innerJoin(MapExpression<?,P> target, Path<P> alias)
           
 com.mysema.commons.lang.CloseableIterator<Object[]> iterate(Expression<?>[] args)
          iterate over the results for the given projection
<RT> com.mysema.commons.lang.CloseableIterator<RT>
iterate(Expression<RT> projection)
          iterate over the results for the given projection
 List<Object[]> list(Expression<?>[] args)
          list the results for the given projection An empty list is returned for no results.
<RT> List<RT>
list(Expression<RT> projection)
          list the results for the given projection An empty list is returned for no results.
<RT> SearchResults<RT>
listResults(Expression<RT> projection)
          list the results for the given projection
 Object[] uniqueResult(Expression<?>[] args)
          return a unique result for the given projection or null if no result is found
<RT> RT
uniqueResult(Expression<RT> expr)
          return a unique result for the given projection or null if no result is found
 
Methods inherited from class com.mysema.query.support.ProjectableQuery
countDistinct, iterate, iterateDistinct, iterateDistinct, iterateDistinct, list, listDistinct, listDistinct, listDistinct, listDistinctResults, map, notExists, singleResult, singleResult, singleResult, uniqueResult, uniqueResult
 
Methods inherited from class com.mysema.query.support.QueryBase
distinct, 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
 

Constructor Detail

AbstractColQuery

public AbstractColQuery(QueryMetadata metadata,
                        QueryEngine queryEngine)
Method Detail

count

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


exists

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

from

public <A> Q from(Path<A> entity,
                  Iterable<? extends A> col)

bind

public <A> Q bind(Path<A> entity,
                  Iterable<? extends A> col)

getMetadata

public abstract QueryMetadata getMetadata()

getQueryEngine

protected QueryEngine getQueryEngine()

innerJoin

public <P> Q innerJoin(CollectionExpression<?,P> target,
                       Path<P> alias)

innerJoin

public <P> Q innerJoin(MapExpression<?,P> target,
                       Path<P> alias)

iterate

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

Returns:

iterate

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

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

list

public List<Object[]> list(Expression<?>[] args)
Description copied from interface: Projectable
list the results for the given projection An empty list is returned for no results.

Specified by:
list in interface Projectable
Overrides:
list in class ProjectableQuery<Q extends AbstractColQuery<Q>>
Returns:

list

public <RT> List<RT> list(Expression<RT> projection)
Description copied from interface: Projectable
list the results for the given projection An empty list is returned for no results.

Specified by:
list in interface Projectable
Overrides:
list in class ProjectableQuery<Q extends AbstractColQuery<Q>>
Type Parameters:
RT - generic type of the List
Returns:
a List over the projection

listResults

public <RT> SearchResults<RT> listResults(Expression<RT> projection)
Description copied from interface: Projectable
list the results for the given projection

Returns:

uniqueResult

public Object[] uniqueResult(Expression<?>[] args)
Description copied from interface: Projectable
return a unique result for the given projection or null if no result is found

Returns:

uniqueResult

public <RT> RT uniqueResult(Expression<RT> expr)
Description copied from interface: Projectable
return a unique result for the given projection or null if no result is found

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


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