org.apache.openjpa.persistence.query
Class QueryBuilderImpl

java.lang.Object
  extended by org.apache.openjpa.persistence.query.QueryBuilderImpl
All Implemented Interfaces:
OpenJPAQueryBuilder, QueryBuilder

public class QueryBuilderImpl
extends Object
implements OpenJPAQueryBuilder

The factory for QueryDefinition.

Author:
Pinaki Poddar

Constructor Summary
QueryBuilderImpl(OpenJPAEntityManagerFactorySPI emf)
           
 
Method Summary
 QueryDefinition createQueryDefinition()
          Creates a QueryDefinition without a domain.
 DomainObject createQueryDefinition(Class root)
          Creates a QueryDefinition with given class as domain.
 QueryDefinition createQueryDefinition(Query jpql)
          Create a QueryDefinition from the given OpenJPA Query instance.
 QueryDefinition createQueryDefinition(String jpql)
          Create a QueryDefinition from the given JPQL String.
 DomainObject createSubqueryDefinition(PathExpression path)
          Creates a QueryDefinition that can be used a correlated subquery with the given path as domain.
 String toJPQL(QueryDefinition query)
          Gets equivalent JPQL String for the given QueryDefinition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryBuilderImpl

public QueryBuilderImpl(OpenJPAEntityManagerFactorySPI emf)
Method Detail

createQueryDefinition

public QueryDefinition createQueryDefinition()
Creates a QueryDefinition without a domain.

Specified by:
createQueryDefinition in interface QueryBuilder
Returns:
query definition instance

createQueryDefinition

public DomainObject createQueryDefinition(Class root)
Creates a QueryDefinition with given class as domain.

Specified by:
createQueryDefinition in interface QueryBuilder
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 interface QueryBuilder
Parameters:
path - - path expression corresponding to the domain object used to derive the subquery root.
Returns:
the subquery DomainObject

toJPQL

public String toJPQL(QueryDefinition query)
Description copied from interface: OpenJPAQueryBuilder
Gets equivalent JPQL String for the given QueryDefinition.

Specified by:
toJPQL in interface OpenJPAQueryBuilder

createQueryDefinition

public QueryDefinition createQueryDefinition(String jpql)
Description copied from interface: OpenJPAQueryBuilder
Create a QueryDefinition from the given JPQL String.

Specified by:
createQueryDefinition in interface OpenJPAQueryBuilder

createQueryDefinition

public QueryDefinition createQueryDefinition(Query jpql)
Description copied from interface: OpenJPAQueryBuilder
Create a QueryDefinition from the given OpenJPA Query instance.

Specified by:
createQueryDefinition in interface OpenJPAQueryBuilder


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.