public abstract class ProjectableQuery<Q extends ProjectableQuery<Q>> extends QueryBase<Q> implements Projectable
QueryBase
class to provide default
implementations of the methods of the Projectable
interfacequeryMixin
Constructor and Description |
---|
ProjectableQuery(QueryMixin<Q> queryMixin) |
Modifier and Type | Method and Description |
---|---|
java.util.List<Tuple> |
list(Expression<?>... args)
list the results for the given projection
An empty list is returned for no results.
|
<RT> java.util.List<RT> |
list(Expression<RT> projection)
list the results for the given projection
An empty list is returned for no results.
|
<K,V> java.util.Map<K,V> |
map(Expression<K> key,
Expression<V> value)
return the given projection as a Map instance using key and value for Map population
An empty map is returned for no results.
|
boolean |
notExists() |
Tuple |
singleResult(Expression<?>... args)
return a single result for the given projection or null if no result is found
|
<RT> RT |
singleResult(Expression<RT> expr)
return a single result for the given projection or null if no result is found
|
<T> T |
transform(ResultTransformer<T> transformer)
Apply the given transformer to this Projectable instance and return the results
|
protected <T> T |
uniqueResult(com.mysema.commons.lang.CloseableIterator<T> it) |
distinct, equals, groupBy, groupBy, hashCode, having, having, limit, offset, orderBy, orderBy, restrict, set, toString, where, where
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
count, exists, iterate, iterate, listResults, listResults, uniqueResult, uniqueResult
public ProjectableQuery(QueryMixin<Q> queryMixin)
public java.util.List<Tuple> list(Expression<?>... args)
Projectable
list
in interface Projectable
public <RT> java.util.List<RT> list(Expression<RT> projection)
Projectable
list
in interface Projectable
RT
- generic type of the Listpublic final <K,V> java.util.Map<K,V> map(Expression<K> key, Expression<V> value)
Projectable
map
in interface Projectable
public final boolean notExists()
notExists
in interface Projectable
public final Tuple singleResult(Expression<?>... args)
Projectable
There is some ambiguity for missing results and null valued results, for disambiguation use the list or iterate methods instead.
for multiple results only the first one is returned
singleResult
in interface Projectable
public final <RT> RT singleResult(Expression<RT> expr)
Projectable
There is some ambiguity for missing results and null valued results, for disambiguation use the list or iterate methods instead.
for multiple results only the first one is returned
singleResult
in interface Projectable
RT
- return typepublic <T> T transform(ResultTransformer<T> transformer)
Projectable
transform
in interface Projectable
@Nullable protected <T> T uniqueResult(com.mysema.commons.lang.CloseableIterator<T> it)
Copyright © 2007-2013 Mysema Ltd. All Rights Reserved.