Package com.querydsl.jpa.hibernate
Class HibernateQueryFactory
- java.lang.Object
-
- com.querydsl.jpa.hibernate.HibernateQueryFactory
-
- All Implemented Interfaces:
QueryFactory<JPQLQuery<?>>,JPQLQueryFactory
public class HibernateQueryFactory extends java.lang.Object implements JPQLQueryFactory
Factory class for query and DML clause creation- Author:
- tiwe
-
-
Constructor Summary
Constructors Constructor Description HibernateQueryFactory(JPQLTemplates templates, java.util.function.Supplier<org.hibernate.Session> session)HibernateQueryFactory(JPQLTemplates templates, org.hibernate.Session session)HibernateQueryFactory(java.util.function.Supplier<org.hibernate.Session> session)HibernateQueryFactory(org.hibernate.Session session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HibernateDeleteClausedelete(EntityPath<?> path)Create a new DELETE clauseHibernateQuery<?>from(EntityPath<?> from)Create a new Query with the given sourceHibernateQuery<?>from(EntityPath<?>... from)Create a new Query with the given sourceHibernateInsertClauseinsert(EntityPath<?> path)Create a new INSERT clauseHibernateQuery<?>query()HibernateQuery<Tuple>select(Expression<?>... exprs)Create a new JPQLQuery instance with the given projection<T> HibernateQuery<T>select(Expression<T> expr)Create a new JPQLQuery instance with the given projectionHibernateQuery<Tuple>selectDistinct(Expression<?>... exprs)Create a new JPQLQuery instance with the given projection<T> HibernateQuery<T>selectDistinct(Expression<T> expr)Create a new JPQLQuery instance with the given projection<T> HibernateQuery<T>selectFrom(EntityPath<T> from)Create a new JPQLQuery instance with the given source and projectionHibernateQuery<java.lang.Integer>selectOne()Create a new JPQLQuery instance with the projection oneHibernateQuery<java.lang.Integer>selectZero()Create a new JPQLQuery instance with the projection zeroHibernateUpdateClauseupdate(EntityPath<?> path)Create a new UPDATE clause
-
-
-
Constructor Detail
-
HibernateQueryFactory
public HibernateQueryFactory(org.hibernate.Session session)
-
HibernateQueryFactory
public HibernateQueryFactory(JPQLTemplates templates, org.hibernate.Session session)
-
HibernateQueryFactory
public HibernateQueryFactory(java.util.function.Supplier<org.hibernate.Session> session)
-
HibernateQueryFactory
public HibernateQueryFactory(JPQLTemplates templates, java.util.function.Supplier<org.hibernate.Session> session)
-
-
Method Detail
-
delete
public HibernateDeleteClause 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> HibernateQuery<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 HibernateQuery<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> HibernateQuery<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 HibernateQuery<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 HibernateQuery<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 HibernateQuery<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> HibernateQuery<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 HibernateQuery<?> 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 HibernateQuery<?> 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 HibernateUpdateClause 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 HibernateInsertClause 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 HibernateQuery<?> query()
- Specified by:
queryin interfaceQueryFactory<JPQLQuery<?>>
-
-