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

public Class DefaultRefactoringTool

extends RefactoringTool
Class Inheritance
Imports
org.eclipse.persistence.jpa.jpql.tools.model.DefaultActualJPQLQueryFormatter, .IJPQLQueryBuilder, .IJPQLQueryFormatter, org.eclipse.persistence.jpa.jpql.tools.spi.IManagedTypeProvider

This utility class provides basic refactoring support.

Provided functionality:

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.4
Version
2.4
See Also
EclipseLinkRefactoringTool

Constructor Summary

AccessConstructor and Description
public
DefaultRefactoringTool(IManagedTypeProvider
The external form of a provider that gives access to the JPA metadata
managedTypeProvider
,
IJPQLQueryBuilder
The builder that creates the StateObject representation of the JPQL query
jpqlQueryBuilder
,
CharSequence
The JPQL query to manipulate
jpqlQuery
)

Creates a new RefactoringTool.

public
DefaultRefactoringTool(IManagedTypeProvider
The external form of a provider that gives access to the JPA metadata
managedTypeProvider
,
IJPQLQueryBuilder
The builder that creates the org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject representation of the JPQL query
jpqlQueryBuilder
,
CharSequence
The JPQL query to manipulate or a single JPQL fragment, which is parsed using the JPQL query BNF identifier by the given ID
jpqlFragment
,
String
The unique identifier of the JPQLQueryBNF that determines how to parse the JPQL fragment
jpqlQueryBNFId
)

Creates a new RefactoringTool.

Method Summary

Modifier and TypeMethod and Description
protected IJPQLQueryFormatter
buildFormatter()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.RefactoringTool.buildFormatter.

Creates a new formatter that will convert the StateObject representation of the JPQL query, once the refactoring occurred into a string.
protected JPQLQueryContext
buildJPQLQueryContext()

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

Creates a new JPQLQueryContext that can retrieve information from the declaration portion of the JPQL query.
Inherited from org.eclipse.persistence.jpa.jpql.tools.RefactoringTool:
buildClassNameRenamerbuildEntityNameRenamerbuildEnumConstantRenamerbuildFieldNameRenamerbuildResultVariableNameRenamerbuildStateObjectbuildVariableNameRenamergetFormattergetGrammargetJPQLQueryBuildergetStateObjectrenameClassNamerenameEntityNamerenameEnumConstantrenameFieldrenameFieldrenameFieldrenameResultVariablerenameVariablesetFormattertoActualText

Constructor Detail

DefaultRefactoringToolback to summary
public DefaultRefactoringTool(IManagedTypeProvider managedTypeProvider, IJPQLQueryBuilder jpqlQueryBuilder, CharSequence jpqlQuery)

Creates a new RefactoringTool.

Parameters
managedTypeProvider:IManagedTypeProvider

The external form of a provider that gives access to the JPA metadata

jpqlQueryBuilder:IJPQLQueryBuilder

The builder that creates the StateObject representation of the JPQL query

jpqlQuery:CharSequence

The JPQL query to manipulate

DefaultRefactoringToolback to summary
public DefaultRefactoringTool(IManagedTypeProvider managedTypeProvider, IJPQLQueryBuilder jpqlQueryBuilder, CharSequence jpqlFragment, String jpqlQueryBNFId)

Creates a new RefactoringTool.

Parameters
managedTypeProvider:IManagedTypeProvider

The external form of a provider that gives access to the JPA metadata

jpqlQueryBuilder:IJPQLQueryBuilder

The builder that creates the org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject representation of the JPQL query

jpqlFragment:CharSequence

The JPQL query to manipulate or a single JPQL fragment, which is parsed using the JPQL query BNF identifier by the given ID

jpqlQueryBNFId:String

The unique identifier of the JPQLQueryBNF that determines how to parse the JPQL fragment

Method Detail

buildFormatterback to summary
protected IJPQLQueryFormatter buildFormatter()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.RefactoringTool.buildFormatter.

Doc from org.eclipse.persistence.jpa.jpql.tools.RefactoringTool.buildFormatter.

Creates a new formatter that will convert the StateObject representation of the JPQL query, once the refactoring occurred into a string.

Returns:IJPQLQueryFormatter

A new concrete instance of IJPQLQueryFormatter

Annotations
@Override
buildJPQLQueryContextback to summary
protected JPQLQueryContext buildJPQLQueryContext()

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

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

Creates a new JPQLQueryContext that can retrieve information from the declaration portion of the JPQL query.

Note

This is temporary because the StateObject API does not have that knowledge yet.

Returns:JPQLQueryContext

A new concrete instance of JPQLQueryContext

Annotations
@Override