Package com.querydsl.core.types
Class QTuple
- All Implemented Interfaces:
Expression<Tuple>,FactoryExpression<Tuple>,Serializable
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));
}
- Author:
- tiwe
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedQTuple(Expression<?>... args) Create a new QTuple instanceprotectedQTuple(Expression<?>[]... args) Create a new QTuple instanceprotectedQTuple(List<Expression<?>> args) Create a new QTuple instance -
Method Summary
Modifier and TypeMethodDescription<R,C> R Accept the visitor with the given contextboolean@Unmodifiable List<Expression<?>>getArgs()Get the invocation argumentsnewInstance(Object... a) Create a projection with the given argumentsMethods inherited from class com.querydsl.core.types.FactoryExpressionBase
skipNullsMethods inherited from class com.querydsl.core.types.ExpressionBase
getType, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.querydsl.core.types.Expression
getType
-
Constructor Details
-
QTuple
Create a new QTuple instance- Parameters:
args-
-
QTuple
Create a new QTuple instance- Parameters:
args-
-
QTuple
Create a new QTuple instance- Parameters:
args-
-
-
Method Details
-
newInstance
Description copied from interface:FactoryExpressionCreate a projection with the given arguments- Parameters:
a- row arguments- Returns:
- constructed value
-
accept
Description copied from interface:ExpressionAccept the visitor with the given context- Type Parameters:
R- return typeC- context type- Parameters:
v- visitorcontext- context of visit- Returns:
- result of visit
-
equals
- Overrides:
equalsin classFactoryExpressionBase<Tuple>
-
getArgs
Description copied from interface:FactoryExpressionGet the invocation arguments- Returns:
- argument expressions
-