Package com.querydsl.jpa.impl
Class JPAQueryFactory
- java.lang.Object
-
- com.querydsl.jpa.impl.JPAQueryFactory
-
- All Implemented Interfaces:
QueryFactory<JPQLQuery<?>>,JPQLQueryFactory
public class JPAQueryFactory extends java.lang.Object implements JPQLQueryFactory
Factory class for query and DML clause creation- Author:
- tiwe
-
-
Constructor Summary
Constructors Constructor Description JPAQueryFactory(JPQLTemplates templates, jakarta.persistence.EntityManager entityManager)JPAQueryFactory(JPQLTemplates templates, java.util.function.Supplier<jakarta.persistence.EntityManager> entityManager)JPAQueryFactory(jakarta.persistence.EntityManager entityManager)JPAQueryFactory(java.util.function.Supplier<jakarta.persistence.EntityManager> entityManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JPADeleteClausedelete(EntityPath<?> path)Create a new DELETE clauseJPAQuery<?>from(EntityPath<?> from)Create a new Query with the given sourceJPAQuery<?>from(EntityPath<?>... from)Create a new Query with the given sourceJPAInsertClauseinsert(EntityPath<?> path)Create a new INSERT clauseJPAQuery<?>query()JPAQuery<Tuple>select(Expression<?>... exprs)Create a new JPQLQuery instance with the given projection<T> JPAQuery<T>select(Expression<T> expr)Create a new JPQLQuery instance with the given projectionJPAQuery<Tuple>selectDistinct(Expression<?>... exprs)Create a new JPQLQuery instance with the given projection<T> JPAQuery<T>selectDistinct(Expression<T> expr)Create a new JPQLQuery instance with the given projection<T> JPAQuery<T>selectFrom(EntityPath<T> from)Create a new JPQLQuery instance with the given source and projectionJPAQuery<java.lang.Integer>selectOne()Create a new JPQLQuery instance with the projection oneJPAQuery<java.lang.Integer>selectZero()Create a new JPQLQuery instance with the projection zeroJPAUpdateClauseupdate(EntityPath<?> path)Create a new UPDATE clause
-
-
-
Constructor Detail
-
JPAQueryFactory
public JPAQueryFactory(jakarta.persistence.EntityManager entityManager)
-
JPAQueryFactory
public JPAQueryFactory(JPQLTemplates templates, jakarta.persistence.EntityManager entityManager)
-
JPAQueryFactory
public JPAQueryFactory(java.util.function.Supplier<jakarta.persistence.EntityManager> entityManager)
-
JPAQueryFactory
public JPAQueryFactory(JPQLTemplates templates, java.util.function.Supplier<jakarta.persistence.EntityManager> entityManager)
-
-
Method Detail
-
delete
public JPADeleteClause delete(EntityPath<?> path)
Description copied from interface:JPQLQueryFactoryCreate a new DELETE clause- Specified by:
deletein interfaceJPQLQueryFactory- Parameters:
path- entity to delete from- Returns:
- delete clause
-
select
public <T> JPAQuery<T> select(Expression<T> expr)
Description copied from interface:JPQLQueryFactoryCreate a new JPQLQuery instance with the given projection- Specified by:
selectin interfaceJPQLQueryFactory- Parameters:
expr- projection- Returns:
- select(expr)
-
select
public JPAQuery<Tuple> select(Expression<?>... exprs)
Description copied from interface:JPQLQueryFactoryCreate a new JPQLQuery instance with the given projection- Specified by:
selectin interfaceJPQLQueryFactory- Parameters:
exprs- projection- Returns:
- select(exprs)
-
selectDistinct
public <T> JPAQuery<T> selectDistinct(Expression<T> expr)
Description copied from interface:JPQLQueryFactoryCreate a new JPQLQuery instance with the given projection- Specified by:
selectDistinctin interfaceJPQLQueryFactory- Parameters:
expr- projection- Returns:
- select(distinct expr)
-
selectDistinct
public JPAQuery<Tuple> selectDistinct(Expression<?>... exprs)
Description copied from interface:JPQLQueryFactoryCreate a new JPQLQuery instance with the given projection- Specified by:
selectDistinctin interfaceJPQLQueryFactory- Parameters:
exprs- projection- Returns:
- select(distinct exprs)
-
selectOne
public JPAQuery<java.lang.Integer> selectOne()
Description copied from interface:JPQLQueryFactoryCreate a new JPQLQuery instance with the projection one- Specified by:
selectOnein interfaceJPQLQueryFactory- Returns:
- select(1)
-
selectZero
public JPAQuery<java.lang.Integer> selectZero()
Description copied from interface:JPQLQueryFactoryCreate a new JPQLQuery instance with the projection zero- Specified by:
selectZeroin interfaceJPQLQueryFactory- Returns:
- select(0)
-
selectFrom
public <T> JPAQuery<T> selectFrom(EntityPath<T> from)
Description copied from interface:JPQLQueryFactoryCreate a new JPQLQuery instance with the given source and projection- Specified by:
selectFromin interfaceJPQLQueryFactory- Parameters:
from- projection and source- Returns:
- select(from).from(from)
-
from
public JPAQuery<?> from(EntityPath<?> from)
Description copied from interface:JPQLQueryFactoryCreate a new Query with the given source- Specified by:
fromin interfaceJPQLQueryFactory- Parameters:
from- from- Returns:
- from(from)
-
from
public JPAQuery<?> from(EntityPath<?>... from)
Description copied from interface:JPQLQueryFactoryCreate a new Query with the given source- Specified by:
fromin interfaceJPQLQueryFactory- Parameters:
from- from- Returns:
- from(from)
-
update
public JPAUpdateClause update(EntityPath<?> path)
Description copied from interface:JPQLQueryFactoryCreate a new UPDATE clause- Specified by:
updatein interfaceJPQLQueryFactory- Parameters:
path- entity to update- Returns:
- update clause
-
insert
public JPAInsertClause insert(EntityPath<?> path)
Description copied from interface:JPQLQueryFactoryCreate a new INSERT clause- Specified by:
insertin interfaceJPQLQueryFactory- Parameters:
path- entity to insert to- Returns:
- insert clause
-
query
public JPAQuery<?> query()
- Specified by:
queryin interfaceQueryFactory<JPQLQuery<?>>
-
-