Package com.querydsl.core.types
Class QBean<T>
java.lang.Object
com.querydsl.core.types.ExpressionBase<T>
com.querydsl.core.types.FactoryExpressionBase<T>
com.querydsl.core.types.QBean<T>
- Type Parameters:
T- bean type
- All Implemented Interfaces:
Expression<T>,FactoryExpression<T>,Serializable
QBean is a JavaBean populating projection type
Example
QEmployee employee = QEmployee.employee;
List<EmployeeInfo> result = query.from(employee)
.where(employee.valid.eq(true))
.select(Projections.bean(EmployeeInfo.class, employee.firstName, employee.lastName))
.fetch();
- Author:
- tiwe
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedQBean(Class<? extends T> type, boolean fieldAccess, Expression<?>... args) Create a new QBean instanceprotectedCreate a new QBean instanceprotectedQBean(Class<? extends T> type, Expression<?>... args) Create a new QBean instanceprotectedCreate a new QBean instance -
Method Summary
Modifier and TypeMethodDescription<R,C> R Accept the visitor with the given contextCreate an alias for the expressionCreate an alias for the expressionprotected <T> TbooleanList<Expression<?>>getArgs()Get the invocation argumentsnewInstance(Object... a) Create a projection with the given argumentsprotected voidpropertyNotFound(Expression<?> expr, String property) protected voidtypeMismatch(Class<?> type, Expression<?> expr) Methods 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
-
QBean
Create a new QBean instance- Parameters:
type- type of beanbindings- bindings
-
QBean
Create a new QBean instance- Parameters:
type- type of beanargs- properties to be populated
-
QBean
Create a new QBean instance- Parameters:
type- type of beanfieldAccess- true, for field access and false, for property accessargs- fields or properties to be populated
-
QBean
protected QBean(Class<? extends T> type, boolean fieldAccess, Map<String, ? extends Expression<?>> bindings) Create a new QBean instance- Parameters:
type- type of beanfieldAccess- true, for field access and false, for property accessbindings- bindings
-
-
Method Details
-
propertyNotFound
-
typeMismatch
-
newInstance
Description copied from interface:FactoryExpressionCreate a projection with the given arguments- Parameters:
a- row arguments- Returns:
- constructed value
-
create
-
as
Create an alias for the expression- Returns:
- this as alias
-
as
Create an alias for the expression- Returns:
- this as alias
-
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<T>
-
getArgs
Description copied from interface:FactoryExpressionGet the invocation arguments- Returns:
- argument expressions
-