|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mysema.query.types.ExpressionBase<T>
com.mysema.query.types.MappingProjection<T>
T - expression typepublic abstract class MappingProjection<T>
Projection template that allows implementing arbitrary mapping of rows to result objects.
Example
MappingProjection<Pair<String,String>> mapping = new MappingProjection<Pair<String,String>>(Pair.class, str1, str2){
@Override
protected Pair<String, String> map(Tuple row) {
return Pair.of(row.get(str1), row.get(str2));
}
};
| Constructor Summary | |
|---|---|
MappingProjection(Class<? super T> type,
Expression<?>... args)
Create a new MappingProjection instance |
|
MappingProjection(Class<? super T> type,
Expression<?>[]... args)
Create a new MappingProjection instance |
|
| Method Summary | ||
|---|---|---|
|
accept(Visitor<R,C> v,
C context)
Accept the visitor with the given context |
|
List<Expression<?>> |
getArgs()
Get the invocation arguments |
|
protected abstract T |
map(Tuple row)
Creates a result object from the given row. |
|
T |
newInstance(Object... values)
Create a projection with the given arguments |
|
| Methods inherited from class com.mysema.query.types.ExpressionBase |
|---|
getType, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.mysema.query.types.Expression |
|---|
getType |
| Constructor Detail |
|---|
public MappingProjection(Class<? super T> type,
Expression<?>... args)
type - args -
public MappingProjection(Class<? super T> type,
Expression<?>[]... args)
type - args - | Method Detail |
|---|
public T newInstance(Object... values)
FactoryExpression
newInstance in interface FactoryExpression<T>protected abstract T map(Tuple row)
row - The row to map
public List<Expression<?>> getArgs()
FactoryExpression
getArgs in interface FactoryExpression<T>
public <R,C> R accept(Visitor<R,C> v,
@Nullable
C context)
Expression
accept in interface Expression<T>R - return typeC - context typev - visitorcontext - context of visit
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||