Class QueryBuilderImpl
- java.lang.Object
-
- org.apache.openjpa.persistence.query.QueryBuilderImpl
-
- All Implemented Interfaces:
OpenJPAQueryBuilder
,QueryBuilder
public class QueryBuilderImpl extends java.lang.Object implements OpenJPAQueryBuilder
The factory for QueryDefinition.- Author:
- Pinaki Poddar
-
-
Constructor Summary
Constructors Constructor Description QueryBuilderImpl(OpenJPAEntityManagerFactorySPI emf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryDefinition
createQueryDefinition()
Creates a QueryDefinition without a domain.DomainObject
createQueryDefinition(java.lang.Class root)
Creates a QueryDefinition with given class as domain.QueryDefinition
createQueryDefinition(java.lang.String jpql)
Create a QueryDefinition from the given JPQL String.QueryDefinition
createQueryDefinition(Query jpql)
Create a QueryDefinition from the given OpenJPA Query instance.DomainObject
createSubqueryDefinition(PathExpression path)
Creates a QueryDefinition that can be used a correlated subquery with the given path as domain.java.lang.String
toJPQL(QueryDefinition query)
Gets equivalent JPQL String for the given QueryDefinition.
-
-
-
Constructor Detail
-
QueryBuilderImpl
public QueryBuilderImpl(OpenJPAEntityManagerFactorySPI emf)
-
-
Method Detail
-
createQueryDefinition
public QueryDefinition createQueryDefinition()
Creates a QueryDefinition without a domain.- Specified by:
createQueryDefinition
in interfaceQueryBuilder
- Returns:
- query definition instance
-
createQueryDefinition
public DomainObject createQueryDefinition(java.lang.Class root)
Creates a QueryDefinition with given class as domain.- Specified by:
createQueryDefinition
in interfaceQueryBuilder
- Returns:
- root domain object
-
createSubqueryDefinition
public DomainObject createSubqueryDefinition(PathExpression path)
Creates a QueryDefinition that can be used a correlated subquery with the given path as domain.- Specified by:
createSubqueryDefinition
in interfaceQueryBuilder
- Parameters:
path
- - path expression corresponding to the domain object used to derive the subquery root.- Returns:
- the subquery DomainObject
-
toJPQL
public java.lang.String toJPQL(QueryDefinition query)
Description copied from interface:OpenJPAQueryBuilder
Gets equivalent JPQL String for the given QueryDefinition.- Specified by:
toJPQL
in interfaceOpenJPAQueryBuilder
-
createQueryDefinition
public QueryDefinition createQueryDefinition(java.lang.String jpql)
Description copied from interface:OpenJPAQueryBuilder
Create a QueryDefinition from the given JPQL String.- Specified by:
createQueryDefinition
in interfaceOpenJPAQueryBuilder
-
createQueryDefinition
public QueryDefinition createQueryDefinition(Query jpql)
Description copied from interface:OpenJPAQueryBuilder
Create a QueryDefinition from the given OpenJPA Query instance.- Specified by:
createQueryDefinition
in interfaceOpenJPAQueryBuilder
-
-