@Immutable public class QTuple extends FactoryExpressionBase<Tuple>
Usage example:
List<Tuple> result = query.from(employee).list(new QTuple(employee.firstName, employee.lastName));
for (Tuple row : result) {
System.out.println("firstName " + row.get(employee.firstName));
System.out.println("lastName " + row.get(employee.lastName));
}
Since Tuple projection is the default for multi column projections, the above is equivalent to this code
List<Tuple> result = query.from(employee).list(employee.firstName, employee.lastName);
for (Tuple row : result) {
System.out.println("firstName " + row.get(employee.firstName));
System.out.println("lastName " + row.get(employee.lastName));
}
Constructor and Description |
---|
QTuple(Expression<?>... args)
Create a new QTuple instance
|
QTuple(Expression<?>[]... args)
Create a new QTuple instance
|
QTuple(com.google.common.collect.ImmutableList<Expression<?>> args)
Create a new QTuple instance
|
Modifier and Type | Method and Description |
---|---|
<R,C> R |
accept(Visitor<R,C> v,
C context)
Accept the visitor with the given context
|
boolean |
equals(Object obj) |
List<Expression<?>> |
getArgs()
Get the invocation arguments
|
Tuple |
newInstance(Object... a)
Create a projection with the given arguments
|
skipNulls
getType, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getType
public QTuple(Expression<?>... args)
args
- public QTuple(com.google.common.collect.ImmutableList<Expression<?>> args)
args
- public QTuple(Expression<?>[]... args)
args
- public Tuple newInstance(Object... a)
FactoryExpression
public <R,C> R accept(Visitor<R,C> v, C context)
Expression
R
- return typeC
- context typev
- visitorcontext
- context of visitpublic List<Expression<?>> getArgs()
FactoryExpression
Copyright © 2007–2015 Mysema Ltd. All rights reserved.