Class EclipseLinkBasicRefactoringTool
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.AbstractRefactoringTool
-
- org.eclipse.persistence.jpa.jpql.tools.BasicRefactoringTool
-
- org.eclipse.persistence.jpa.jpql.tools.EclipseLinkBasicRefactoringTool
-
public class EclipseLinkBasicRefactoringTool extends BasicRefactoringTool
This utility class provides basic refactoring support. This version adds support for EclipseLink specific extension over the default implementation of JPQL defined in the Java Persistence functional specification and it does not changes theStateObject
but rather gather the changes inRefactoringDelta
and it is the responsibility of the invoker to the actual change.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:
DefaultBasicRefactoringTool
- Author:
- Pascal Filion
- Since:
- 2.4
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.jpa.jpql.tools.BasicRefactoringTool
BasicRefactoringTool.AbstractRenamer, BasicRefactoringTool.AttributeNameRenamer, BasicRefactoringTool.ClassNameRenamer, BasicRefactoringTool.EntityNameRenamer, BasicRefactoringTool.EnumConstantRenamer, BasicRefactoringTool.JavaQuery, BasicRefactoringTool.ResultVariableNameRenamer, BasicRefactoringTool.VariableNameRenamer
-
-
Constructor Summary
Constructors Constructor Description EclipseLinkBasicRefactoringTool(java.lang.CharSequence jpqlQuery, JPQLGrammar jpqlGrammar, IManagedTypeProvider managedTypeProvider)
Creates a newEclipseLinkBasicRefactoringTool
.EclipseLinkBasicRefactoringTool(java.lang.CharSequence jpqlFragment, JPQLGrammar jpqlGrammar, IManagedTypeProvider managedTypeProvider, java.lang.String jpqlQueryBNFId)
Creates a newEclipseLinkBasicRefactoringTool
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.BasicRefactoringTool
buildAttributeNameRenamer, buildClassNameRenamer, buildEntityNameRenamer, buildEnumConstantRenamer, buildResultVariableNameRenamer, buildVariableNameRenamer, getDelta, getExpression, getGrammar, getQueryContext, hasChanges, renameAttribute, renameAttribute, renameAttribute, renameClassName, renameEntityName, renameEnumConstant, renameResultVariable, renameVariable, toActualText
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.AbstractRefactoringTool
getJPQLFragment, getJPQLQueryBNFId, getManagedTypeProvider, isTolerant, setTolerant
-
-
-
-
Constructor Detail
-
EclipseLinkBasicRefactoringTool
public EclipseLinkBasicRefactoringTool(java.lang.CharSequence jpqlQuery, JPQLGrammar jpqlGrammar, IManagedTypeProvider managedTypeProvider)
Creates a newEclipseLinkBasicRefactoringTool
.- Parameters:
jpqlQuery
- The JPQL query to manipulatejpqlGrammar
- TheJPQLGrammar
that was used to parse the JPQL querymanagedTypeProvider
- The external form of a provider that gives access to the JPA metadata
-
EclipseLinkBasicRefactoringTool
public EclipseLinkBasicRefactoringTool(java.lang.CharSequence jpqlFragment, JPQLGrammar jpqlGrammar, IManagedTypeProvider managedTypeProvider, java.lang.String jpqlQueryBNFId)
Creates a newEclipseLinkBasicRefactoringTool
.- Parameters:
jpqlFragment
- The JPQL query to manipulate or a single JPQL fragment, which is parsed using the JPQL query BNF identifier by the given IDjpqlGrammar
- TheJPQLGrammar
that was used to parse the JPQL fragmentmanagedTypeProvider
- The external form of a provider that gives access to the JPA metadatajpqlQueryBNFId
- The unique identifier of theJPQLQueryBNF
that determines how to parse the JPQL fragment
-
-
Method Detail
-
buildJPQLQueryContext
protected JPQLQueryContext buildJPQLQueryContext()
Creates a newJPQLQueryContext
that can retrieve information from the declaration portion of the JPQL query.- Specified by:
buildJPQLQueryContext
in classBasicRefactoringTool
- Returns:
- A new concrete instance of
JPQLQueryContext
-
-