Package cz.encircled.joiner.query.join
Class J
java.lang.Object
cz.encircled.joiner.query.join.J
This class contains helper methods for
joins building- Author:
- Kisel on 26.01.2016.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JoinDescriptioninner(com.querydsl.core.types.dsl.CollectionPathBase<?, ?, ?> path) Add inner join for givenpathstatic JoinDescriptioninner(com.querydsl.core.types.EntityPath<?> path) Add inner join for givenpathstatic JoinDescriptionleft(com.querydsl.core.types.dsl.CollectionPathBase<?, ?, ?> path) Add left join for givenpathstatic JoinDescriptionleft(com.querydsl.core.types.EntityPath<?> path) Add left join for givenpathstatic <P extends com.querydsl.core.types.dsl.SimpleExpression<?>,T extends com.querydsl.core.types.EntityPath<P>>
Ppath(com.querydsl.core.types.dsl.CollectionPathBase<?, ?, P> path) Aliases of nested joins are determined at runtime.static <T extends com.querydsl.core.types.EntityPath<?>>
Tpath(com.querydsl.core.types.EntityPath<?> grandFather, com.querydsl.core.types.EntityPath<?> father, T path) Aliases of nested joins are determined at runtime.static <T extends com.querydsl.core.types.EntityPath<?>>
Tpath(com.querydsl.core.types.EntityPath<?> parent, T path) Aliases of nested joins are determined at runtime.static JoinDescriptionright(com.querydsl.core.types.EntityPath<?> path) Add right join for givenpathstatic List<JoinDescription>Collect all joins and its children to single collection
-
Constructor Details
-
J
public J()
-
-
Method Details
-
path
public static <P extends com.querydsl.core.types.dsl.SimpleExpression<?>,T extends com.querydsl.core.types.EntityPath<P>> P path(com.querydsl.core.types.dsl.CollectionPathBase<?, ?, P> path) Aliases of nested joins are determined at runtime. To refer a nested join, this method should be used to get a correct alias. For example, there is a query
To refer aQ.from(QGroup.group).joins(J.left(QPerson.person).nested(J.left(QContact.contact)))Contactentity in the 'where' clause, one should useJ.path(QPerson.person.contacts).number.eq(12345)- Type Parameters:
T- any entity path- Parameters:
path- path on parent entity- Returns:
- entity path with correct alias
-
path
public static <T extends com.querydsl.core.types.EntityPath<?>> T path(com.querydsl.core.types.EntityPath<?> parent, T path) Aliases of nested joins are determined at runtime. To refer a nested join, this method should be used to get a correct alias. For example, there is a query
To refer aQ.from(QGroup.group).joins(J.left(QPerson.person).nested(J.left(QContact.contact)))Contactentity in the 'where' clause, one should useJ.path(QPerson.person, QContact.contact).number.eq(12345)- Type Parameters:
T- any entity path- Parameters:
parent- parent join pathpath- target join path- Returns:
- entity path with correct alias
-
path
public static <T extends com.querydsl.core.types.EntityPath<?>> T path(com.querydsl.core.types.EntityPath<?> grandFather, com.querydsl.core.types.EntityPath<?> father, T path) Aliases of nested joins are determined at runtime. To refer a nested join, this method should be used to get a correct alias. For example, there is a query
To refer aQ.from(QGroup.group).joins(J.left(QPerson.person).nested(J.left(QContact.contact).nested(QStatus.status)))Statusentity in the 'where' clause, one should useJ.path(QPerson.person, QContact.contact. QStatus.status).state.eq("active")- Type Parameters:
T- any entity path- Parameters:
grandFather- parent of parent join pathfather- parent join pathpath- target join path- Returns:
- entity path with correct alias
-
left
Add left join for givenpath- Parameters:
path- alias of object to be joined- Returns:
- join description
-
right
Add right join for givenpath- Parameters:
path- alias of object to be joined- Returns:
- join description
-
left
Add left join for givenpath- Parameters:
path- path to an object to be joined- Returns:
- join description
-
inner
Add inner join for givenpath- Parameters:
path- alias of object to be joined- Returns:
- join description
-
inner
Add inner join for givenpath- Parameters:
path- path to an object to be joined- Returns:
- join description
-
unrollChildrenJoins
Collect all joins and its children to single collection- Parameters:
joins- root joins- Returns:
- all joins, including children
-