Top Description Constructors Methods
org.eclipse.persistence.jpa.jpql.tools

public Class DefaultJPQLQueryHelper

extends AbstractJPQLQueryHelper
Class Inheritance
Imports
org.eclipse.persistence.jpa.jpql.parser.JPQLGrammar, org.eclipse.persistence.jpa.jpql.tools.model.IJPQLQueryBuilder, .JPQLQueryBuilder1_0, .JPQLQueryBuilder2_0, .JPQLQueryBuilder2_1, org.eclipse.persistence.jpa.jpql.tools.spi.IQuery

This helper can perform the following operations over a JPQL query: This helper should be used when the JPQL query is written using the JPQL grammar defined in the Java Persistence functional specification 1.0 or 2.x.

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

Author
Pascal Filion
Since
2.3
Version
2.5

Constructor Summary

AccessConstructor and Description
public
DefaultJPQLQueryHelper(JPQLGrammar
The JPQLGrammar that will determine how to parse JPQL queries
jpqlGrammar
)

Creates a new DefaultJPQLQueryHelper.

public
DefaultJPQLQueryHelper(JPQLQueryContext
The context used to query information about the JPQL query
queryContext
)

Creates a new JPQLQueryHelper.

Method Summary

Modifier and TypeMethod and Description
public BasicRefactoringTool
buildBasicRefactoringTool()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildBasicRefactoringTool.

Creates the concrete instance of the tool that can refactor the content of a JPQL query.
protected AbstractContentAssistVisitor
buildContentAssistVisitor(JPQLQueryContext
The context used to query information about the JPQL query
queryContext
)

Implements abstract org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildContentAssistVisitor.

Creates the concrete instance of the content assist visitor that will give the possible choices based on the position of the cursor within the JPQL query.
protected DefaultGrammarValidator
buildGrammarValidator(JPQLGrammar
The context used to query information about the JPQL query
jpqlGrammar
)

Implements abstract org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildGrammarValidator.

Creates the concrete instance of the validator that will grammatically validate the JPQL query.
protected JPQLQueryContext
buildJPQLQueryContext(JPQLGrammar
The JPQL grammar that is required for dictating how the JPQL query will be parsed. It is also used by validation and by the content assist
jpqlGrammar
)

Implements abstract org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildJPQLQueryContext.

Creates a context that will be used to store and retrieve information about the JPQL query.
protected IJPQLQueryBuilder

Returns:

A new concrete instance of IJPQLQueryBuilder
buildQueryBuilder
()

Creates the right IJPQLQueryBuilder based on the JPQL grammar.

public RefactoringTool
buildRefactoringTool()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildRefactoringTool.

Creates the concrete instance of the tool that can refactor the content of a JPQL query.
protected DefaultSemanticValidator
buildSemanticValidator(JPQLQueryContext
The context used to query information about the JPQL query
queryContext
)

Implements abstract org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildSemanticValidator.

Creates the concrete instance of the validator that will semantically validate the JPQL query.
Inherited from org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper:
buildContentAssistProposalsbuildContentAssistProposalsbuildNumericTypeComparatordisposegetContentAssistVisitorgetGrammargetGrammarValidatorgetJPQLExpressiongetParameterTypegetParsedJPQLQuerygetProvidergetQuerygetQueryContextgetResultTypegetSemanticValidatorgetTypegetTypeHelpergetTypeRepositorysetJPQLExpressionsetQueryvalidatevalidatevalidateGrammarvalidateGrammarvalidateSemanticvalidateSemantic

Constructor Detail

DefaultJPQLQueryHelperback to summary
public DefaultJPQLQueryHelper(JPQLGrammar jpqlGrammar)

Creates a new DefaultJPQLQueryHelper.

Parameters
jpqlGrammar:JPQLGrammar

The JPQLGrammar that will determine how to parse JPQL queries

DefaultJPQLQueryHelperback to summary
public DefaultJPQLQueryHelper(JPQLQueryContext queryContext)

Creates a new JPQLQueryHelper.

Parameters
queryContext:JPQLQueryContext

The context used to query information about the JPQL query

Method Detail

buildBasicRefactoringToolback to summary
public BasicRefactoringTool buildBasicRefactoringTool()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildBasicRefactoringTool.

Doc from org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildBasicRefactoringTool.

Creates the concrete instance of the tool that can refactor the content of a JPQL query. This version simply provides the delta of the refactoring operations.

Returns:BasicRefactoringTool

The concrete instance of RefactoringTool

Annotations
@Override
buildContentAssistVisitorback to summary
protected AbstractContentAssistVisitor buildContentAssistVisitor(JPQLQueryContext queryContext)

Implements abstract org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildContentAssistVisitor.

Doc from org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildContentAssistVisitor.

Creates the concrete instance of the content assist visitor that will give the possible choices based on the position of the cursor within the JPQL query.

Parameters
queryContext:JPQLQueryContext

The context used to query information about the JPQL query

Returns:AbstractContentAssistVisitor

A new concrete instance of AbstractContentAssistVisitor

Annotations
@Override
buildGrammarValidatorback to summary
protected DefaultGrammarValidator buildGrammarValidator(JPQLGrammar jpqlGrammar)

Implements abstract org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildGrammarValidator.

Doc from org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildGrammarValidator.

Creates the concrete instance of the validator that will grammatically validate the JPQL query.

Parameters
jpqlGrammar:JPQLGrammar

The context used to query information about the JPQL query

Returns:DefaultGrammarValidator

A new concrete instance of AbstractGrammarValidator

Annotations
@Override
buildJPQLQueryContextback to summary
protected JPQLQueryContext buildJPQLQueryContext(JPQLGrammar jpqlGrammar)

Implements abstract org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildJPQLQueryContext.

Doc from org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildJPQLQueryContext.

Creates a context that will be used to store and retrieve information about the JPQL query.

Parameters
jpqlGrammar:JPQLGrammar

The JPQL grammar that is required for dictating how the JPQL query will be parsed. It is also used by validation and by the content assist

Returns:JPQLQueryContext

A new JPQLQueryContext

Annotations
@Override
buildQueryBuilderback to summary
protected IJPQLQueryBuilder buildQueryBuilder()

Creates the right IJPQLQueryBuilder based on the JPQL grammar.

Returns:IJPQLQueryBuilder

A new concrete instance of IJPQLQueryBuilder

buildRefactoringToolback to summary
public RefactoringTool buildRefactoringTool()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildRefactoringTool.

Doc from org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildRefactoringTool.

Creates the concrete instance of the tool that can refactor the content of a JPQL query. This version provides a way to manipulate the editable version of the JPQL query (StateObject and simply outputs the result of the refactoring operations, i.e. the updated JPQL query).

Returns:RefactoringTool

The concrete instance of RefactoringTool

Annotations
@Override
buildSemanticValidatorback to summary
protected DefaultSemanticValidator buildSemanticValidator(JPQLQueryContext queryContext)

Implements abstract org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildSemanticValidator.

Doc from org.eclipse.persistence.jpa.jpql.tools.AbstractJPQLQueryHelper.buildSemanticValidator.

Creates the concrete instance of the validator that will semantically validate the JPQL query.

Parameters
queryContext:JPQLQueryContext

The context used to query information about the JPQL query

Returns:DefaultSemanticValidator

A new concrete instance of AbstractSemanticValidator

Annotations
@Override