Class EclipseLinkRefactoringTool
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.AbstractRefactoringTool
-
- org.eclipse.persistence.jpa.jpql.tools.RefactoringTool
-
- org.eclipse.persistence.jpa.jpql.tools.EclipseLinkRefactoringTool
-
public class EclipseLinkRefactoringTool extends RefactoringTool
This refactoring tool add support for EclipseLink specific extension over the default implementation of JPQL defined in the Java Persistence functional specification.Provided functionality:
- Renaming an identification variable;
- Renaming a state field or collection-valued field;
- Renaming an entity name;
- Renaming a
Class
name (e.g.: in constructor expression); - Renaming an
Enum
constant.
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.
- Version:
- 2.4
- See Also:
DefaultRefactoringTool
- Author:
- Pascal Filion
- Since:
- 2.4
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.jpa.jpql.tools.RefactoringTool
RefactoringTool.ClassNameRenamer, RefactoringTool.EntityNameRenamer, RefactoringTool.EnumConstantRenamer, RefactoringTool.FieldNameRenamer, RefactoringTool.ResultVariableNameRenamer, RefactoringTool.StateObjectUpdater<T extends StateObject>, RefactoringTool.VariableNameRenamer
-
-
Constructor Summary
Constructors Constructor Description EclipseLinkRefactoringTool(IManagedTypeProvider managedTypeProvider, IJPQLQueryBuilder jpqlQueryBuilder, java.lang.CharSequence jpqlQuery)
Creates a newEclipseLinkRefactoringTool
.EclipseLinkRefactoringTool(IManagedTypeProvider managedTypeProvider, IJPQLQueryBuilder jpqlQueryBuilder, java.lang.CharSequence jpqlFragment, java.lang.String jpqlQueryBNFId)
Creates a newEclipseLinkRefactoringTool
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IJPQLQueryFormatter
buildFormatter()
Creates a new formatter that will convert theStateObject
representation of the JPQL query, once the refactoring occurred into a string.protected JPQLQueryContext
buildJPQLQueryContext()
Creates a newJPQLQueryContext
that can retrieve information from the declaration portion of the JPQL query.-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.RefactoringTool
buildClassNameRenamer, buildEntityNameRenamer, buildEnumConstantRenamer, buildFieldNameRenamer, buildResultVariableNameRenamer, buildStateObject, buildVariableNameRenamer, getFormatter, getGrammar, getJPQLQueryBuilder, getStateObject, renameClassName, renameEntityName, renameEnumConstant, renameField, renameField, renameField, renameResultVariable, renameVariable, setFormatter, toActualText
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.AbstractRefactoringTool
getJPQLFragment, getJPQLQueryBNFId, getManagedTypeProvider, isTolerant, setTolerant
-
-
-
-
Constructor Detail
-
EclipseLinkRefactoringTool
public EclipseLinkRefactoringTool(IManagedTypeProvider managedTypeProvider, IJPQLQueryBuilder jpqlQueryBuilder, java.lang.CharSequence jpqlQuery)
Creates a newEclipseLinkRefactoringTool
.- Parameters:
managedTypeProvider
- The external form of a provider that gives access to the JPA metadatajpqlQueryBuilder
- The builder that creates theStateObject
representation of the JPQL queryjpqlQuery
- The JPQL query to manipulate
-
EclipseLinkRefactoringTool
public EclipseLinkRefactoringTool(IManagedTypeProvider managedTypeProvider, IJPQLQueryBuilder jpqlQueryBuilder, java.lang.CharSequence jpqlFragment, java.lang.String jpqlQueryBNFId)
Creates a newEclipseLinkRefactoringTool
.- Parameters:
managedTypeProvider
- The external form of a provider that gives access to the JPA metadatajpqlQueryBuilder
- The builder that creates theStateObject
representation of the JPQL queryjpqlFragment
- The JPQL query to manipulate or a single JPQL fragment, which is parsed using the JPQL query BNF identifier by the given IDjpqlQueryBNFId
- The unique identifier of theJPQLQueryBNF
that determines how to parse the JPQL fragment
-
-
Method Detail
-
buildFormatter
protected IJPQLQueryFormatter buildFormatter()
Creates a new formatter that will convert theStateObject
representation of the JPQL query, once the refactoring occurred into a string.- Specified by:
buildFormatter
in classRefactoringTool
- Returns:
- A new concrete instance of
IJPQLQueryFormatter
-
buildJPQLQueryContext
protected JPQLQueryContext buildJPQLQueryContext()
Creates a newJPQLQueryContext
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.- Specified by:
buildJPQLQueryContext
in classRefactoringTool
- Returns:
- A new concrete instance of
JPQLQueryContext
-
-