Package com.querydsl.core.types.dsl
Class PathBuilder<T>
java.lang.Object
com.querydsl.core.types.dsl.DslExpression<T>
com.querydsl.core.types.dsl.SimpleExpression<T>
com.querydsl.core.types.dsl.BeanPath<T>
com.querydsl.core.types.dsl.EntityPathBase<T>
com.querydsl.core.types.dsl.PathBuilder<T>
- Type Parameters:
T- expression type
- All Implemented Interfaces:
EntityPath<T>,Expression<T>,Path<T>,Serializable
PathBuilder is an extension to EntityPathBase for dynamic path construction
Usage example:
PathBuilder<User> user = new PathBuilder<User>(User.class, "user");
Predicate filter = user.getString("firstName").eq("Bob");
List<User> users = query.from(user).where(filter).select(user).fetch();
- Author:
- tiwe
- See Also:
-
Field Summary
Fields inherited from class com.querydsl.core.types.dsl.DslExpression
hashCode, mixin -
Constructor Summary
ConstructorsConstructorDescriptionPathBuilder(Class<? extends T> type, PathMetadata pathMetadata) Creates a new PathBuilder instancePathBuilder(Class<? extends T> type, PathMetadata pathMetadata, PathBuilderValidator validator) Creates a new PathBuilder instancePathBuilder(Class<? extends T> type, String variable) Creates a new PathBuilder instancePathBuilder(Class<? extends T> type, String variable, PathBuilderValidator validator) Creates a new PathBuilder instance -
Method Summary
Modifier and TypeMethodDescriptionget(BooleanPath path) Create a new Boolean typed path<A extends Comparable<?>>
ComparablePath<A>get(ComparablePath<A> path) Create a new Comparable typed path<A extends Comparable<?>>
DatePath<A>Create a new Date path<A extends Comparable<?>>
DateTimePath<A>get(DateTimePath<A> path) Create a new DateTime pathCreate a new Enum path<A extends Number & Comparable<?>>
NumberPath<A>get(NumberPath<A> path) Create a new Number typed pathget(StringPath path) Create a new String typed path<A extends Comparable<?>>
TimePath<A>Create a new Time typed path<A> SimplePath<A>Create a new Simple pathCreate a PathBuilder instance for the given property<A> PathBuilder<A>Create a PathBuilder for the given property with the given type<A,E> ArrayPath<A, E> Create a ArrayPath instance for the given property and the given array typegetBoolean(String propertyName) Create a new Boolean typed path<A> CollectionPath<A,PathBuilder<A>> getCollection(String property, Class<A> type) Create a new Collection typed path<A,E extends SimpleExpression<A>>
CollectionPath<A,E> getCollection(String property, Class<A> type, Class<? super E> queryType) Create a new Collection typed path<A extends Comparable<?>>
ComparablePath<A>getComparable(String property, Class<A> type) Create a new Comparable typed path<A extends Comparable<?>>
DatePath<A>Create a new Date path<A extends Comparable<?>>
DateTimePath<A>getDateTime(String property, Class<A> type) Create a new DateTime pathCreate a new Enum path<A> ListPath<A,PathBuilder<A>> Create a new List typed path<A,E extends SimpleExpression<A>>
ListPath<A,E> Create a new List typed path<K,V> MapPath<K, V, PathBuilder<V>> Create a new Map typed path<K,V, E extends SimpleExpression<V>>
MapPath<K,V, E> Create a new Map typed pathgetMetadata(Path<?> property) Returns additional metadata for the given property path or null if none is available<A extends Number & Comparable<?>>
NumberPath<A>Create a new Number typed path<A> SetPath<A,PathBuilder<A>> Create a new Set typed path<A,E extends SimpleExpression<A>>
SetPath<A,E> Create a new Set typed path<A> SimplePath<A>Create a new Simple pathCreate a new String typed path<A extends Comparable<?>>
TimePath<A>Create a new Time typed pathprotected <A> Class<? extends A>Methods inherited from class com.querydsl.core.types.dsl.BeanPath
accept, add, as, createArray, createBoolean, createCollection, createComparable, createDate, createDateTime, createEnum, createList, createMap, createNumber, createSet, createSimple, createString, createTime, forProperty, getAnnotatedElement, getMetadata, getRoot, instanceOf, instanceOfAnyMethods inherited from class com.querydsl.core.types.dsl.SimpleExpression
as, as, count, countDistinct, eq, eq, eqAll, eqAll, eqAny, eqAny, in, in, in, in, in, isNotNull, isNull, ne, ne, neAll, neAny, notIn, notIn, notIn, notIn, notIn, nullif, nullif, when, whenMethods inherited from class com.querydsl.core.types.dsl.DslExpression
equals, 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
accept, getTypeMethods inherited from interface com.querydsl.core.types.Path
getAnnotatedElement, getMetadata, getRoot
-
Constructor Details
-
PathBuilder
public PathBuilder(Class<? extends T> type, PathMetadata pathMetadata, PathBuilderValidator validator) Creates a new PathBuilder instance- Parameters:
type- type of the expressionpathMetadata- path metadatavalidator- validator for property creation
-
PathBuilder
Creates a new PathBuilder instance- Parameters:
type- type of the expressionpathMetadata- path metadata
-
PathBuilder
Creates a new PathBuilder instance- Parameters:
type- type of the expressionvariable- variable namevalidator- validator for property creation
-
PathBuilder
Creates a new PathBuilder instance- Parameters:
type- type of the expressionvariable- variable name
-
-
Method Details
-
validate
-
getMetadata
Description copied from interface:EntityPathReturns additional metadata for the given property path or null if none is available- Specified by:
getMetadatain interfaceEntityPath<T>- Overrides:
getMetadatain classEntityPathBase<T>- Parameters:
property- property path- Returns:
- metadata for property or null
-
get
Create a PathBuilder instance for the given property- Parameters:
property- property name- Returns:
- property path
-
get
Create a PathBuilder for the given property with the given type- Type Parameters:
A-- Parameters:
property- property nametype- property type- Returns:
- property path
-
getArray
Create a ArrayPath instance for the given property and the given array type- Type Parameters:
A-E-- Parameters:
property- property nametype- property type- Returns:
- property path
-
get
Create a new Boolean typed path- Parameters:
path- existing path- Returns:
- property path
-
getBoolean
Create a new Boolean typed path- Parameters:
propertyName- property name- Returns:
- property path
-
getCollection
Create a new Collection typed path- Type Parameters:
A-- Parameters:
property- property nametype- property type- Returns:
- property path
-
getCollection
public <A,E extends SimpleExpression<A>> CollectionPath<A,E> getCollection(String property, Class<A> type, Class<? super E> queryType) Create a new Collection typed path- Type Parameters:
A-E-- Parameters:
property- property nametype- property typequeryType- expression type- Returns:
- property path
-
get
Create a new Comparable typed path- Type Parameters:
A-- Parameters:
path- existing path- Returns:
- property path
-
getComparable
Create a new Comparable typed path- Type Parameters:
A-- Parameters:
property- property nametype- property type- Returns:
- property path
-
get
Create a new Date path- Type Parameters:
A-- Parameters:
path- existing path- Returns:
- property path
-
getDate
Create a new Date path- Type Parameters:
A-- Parameters:
property- property nametype- property type- Returns:
- property path
-
get
Create a new DateTime path- Type Parameters:
A-- Parameters:
path- existing path- Returns:
- property path
-
getDateTime
Create a new DateTime path- Type Parameters:
A-- Parameters:
property- property nametype- property type- Returns:
- property path
-
getEnum
Create a new Enum path- Type Parameters:
A-- Parameters:
property- property nametype- property type- Returns:
- property path
-
get
Create a new Enum path- Type Parameters:
A-- Parameters:
path- existing path- Returns:
- property path
-
getList
Create a new List typed path- Type Parameters:
A-- Parameters:
property- property nametype- property type- Returns:
- property path
-
getList
public <A,E extends SimpleExpression<A>> ListPath<A,E> getList(String property, Class<A> type, Class<? super E> queryType) Create a new List typed path- Type Parameters:
A-E-- Parameters:
property- property nametype- property typequeryType- expression type- Returns:
- property path
-
getMap
Create a new Map typed path- Type Parameters:
K-V-- Parameters:
property- property namekey- key typevalue- value type- Returns:
- property path
-
getMap
public <K,V, MapPath<K,E extends SimpleExpression<V>> V, getMapE> (String property, Class<K> key, Class<V> value, Class<? super E> queryType) Create a new Map typed path- Type Parameters:
K-V-E-- Parameters:
property- property namekey- key typevalue- value typequeryType- vaue expression type- Returns:
- property path
-
get
Create a new Number typed path- Type Parameters:
A-- Parameters:
path- existing path- Returns:
- property path
-
getNumber
Create a new Number typed path- Type Parameters:
A-- Parameters:
property- property nametype- property type- Returns:
- property path
-
getSet
Create a new Set typed path- Type Parameters:
A-- Parameters:
property- property nametype- property type- Returns:
- property path
-
getSet
public <A,E extends SimpleExpression<A>> SetPath<A,E> getSet(String property, Class<A> type, Class<? super E> queryType) Create a new Set typed path- Type Parameters:
A-E-- Parameters:
property- property nametype- property typequeryType- expression type- Returns:
- property path
-
get
Create a new Simple path- Type Parameters:
A-- Parameters:
path- existing path- Returns:
- property path
-
getSimple
Create a new Simple path- Type Parameters:
A-- Parameters:
property- property nametype- property type- Returns:
- property path
-
get
Create a new String typed path- Parameters:
path- existing path- Returns:
- property path
-
getString
Create a new String typed path- Parameters:
property- property name- Returns:
- property path
-
get
Create a new Time typed path- Type Parameters:
A-- Parameters:
path- existing path- Returns:
- property path
-
getTime
Create a new Time typed path- Type Parameters:
A-- Parameters:
property- property nametype- property type- Returns:
- property path
-