@Immutable public class QTuple extends FactoryExpressionBase<Tuple>
QTuple represents a projection of type Tuple
Usage example:
List<Tuple> result = query.from(employee).select(Projections.tuple(employee.firstName, employee.lastName)).fetch();
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).select(employee.firstName, employee.lastName).fetch();
for (Tuple row : result) {
System.out.println("firstName " + row.get(employee.firstName));
System.out.println("lastName " + row.get(employee.lastName));
}
| Modifier | Constructor and Description |
|---|---|
protected |
QTuple(Expression<?>... args)
Create a new QTuple instance
|
protected |
QTuple(Expression<?>[]... args)
Create a new QTuple instance
|
protected |
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
|
skipNullsgetType, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetTypeprotected QTuple(Expression<?>... args)
args - protected QTuple(com.google.common.collect.ImmutableList<Expression<?>> args)
args - protected QTuple(Expression<?>[]... args)
args - public Tuple newInstance(Object... a)
FactoryExpressiona - row argumentspublic <R,C> R accept(Visitor<R,C> v, C context)
ExpressionR - return typeC - context typev - visitorcontext - context of visitpublic boolean equals(Object obj)
equals in class FactoryExpressionBase<Tuple>public List<Expression<?>> getArgs()
FactoryExpressionCopyright © 2007–2020 Querydsl. All rights reserved.