Class RefactoringTool.ResultVariableNameRenamer
java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.model.query.AnonymousStateObjectVisitor
org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractTraverseChildrenVisitor
org.eclipse.persistence.jpa.jpql.tools.RefactoringTool.ResultVariableNameRenamer
- All Implemented Interfaces:
StateObjectVisitor
- Enclosing class:
RefactoringTool
protected static class RefactoringTool.ResultVariableNameRenamer
extends AbstractTraverseChildrenVisitor
This visitor renames all the result variables found in the JPQL query.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionResultVariableNameRenamer
(String oldVariableName, String newVariableName) Creates a newResultVariableNameRenamer
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
visit
(IdentificationVariableStateObject stateObject) Visits the givenIdentificationVariableStateObject
.void
visit
(JPQLQueryStateObject stateObject) Visits the givenJPQLQueryStateObject
.void
visit
(OrderByItemStateObject stateObject) Visits the givenOrderByItemStateObject
.void
visit
(ResultVariableStateObject stateObject) Visits the givenResultVariableStateObject
.void
visit
(SelectStatementStateObject stateObject) Visits the givenSelectStatementStateObject
.Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractTraverseChildrenVisitor
visit
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.model.query.AnonymousStateObjectVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Field Details
-
newVariableName
The new name of the result variable. -
oldVariableName
The current result variable name. -
renameIdentificationVariable
protected boolean renameIdentificationVariableMakes sure an identification variable is renamed only when it's used by an order by item.
-
-
Constructor Details
-
ResultVariableNameRenamer
Creates a newResultVariableNameRenamer
.- Parameters:
oldVariableName
- The current result variable namenewVariableName
- The new name of the result variable
-
-
Method Details
-
visit
Description copied from interface:StateObjectVisitor
Visits the givenIdentificationVariableStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheIdentificationVariableStateObject
to visit
-
visit
Description copied from interface:StateObjectVisitor
Visits the givenJPQLQueryStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheJPQLQueryStateObject
to visit
-
visit
Description copied from interface:StateObjectVisitor
Visits the givenOrderByItemStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheOrderByItemStateObject
to visit
-
visit
Description copied from interface:StateObjectVisitor
Visits the givenResultVariableStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheResultVariableStateObject
to visit
-
visit
Description copied from interface:StateObjectVisitor
Visits the givenSelectStatementStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheSelectStatementStateObject
to visit
-