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
Fields Modifier and Type Field Description protected java.lang.String
newVariableName
The new name of the result variable.protected java.lang.String
oldVariableName
The current result variable name.protected boolean
renameIdentificationVariable
Makes sure an identification variable is renamed only when it's used by an order by item.
-
Constructor Summary
Constructors Constructor Description ResultVariableNameRenamer(java.lang.String oldVariableName, java.lang.String newVariableName)
Creates a newResultVariableNameRenamer
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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 Detail
-
newVariableName
protected final java.lang.String newVariableName
The new name of the result variable.
-
oldVariableName
protected final java.lang.String oldVariableName
The current result variable name.
-
renameIdentificationVariable
protected boolean renameIdentificationVariable
Makes sure an identification variable is renamed only when it's used by an order by item.
-
-
Constructor Detail
-
ResultVariableNameRenamer
public ResultVariableNameRenamer(java.lang.String oldVariableName, java.lang.String newVariableName)
Creates a newResultVariableNameRenamer
.- Parameters:
oldVariableName
- The current result variable namenewVariableName
- The new name of the result variable
-
-
Method Detail
-
visit
public void visit(IdentificationVariableStateObject stateObject)
Visits the givenIdentificationVariableStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheIdentificationVariableStateObject
to visit
-
visit
public void visit(JPQLQueryStateObject stateObject)
Visits the givenJPQLQueryStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheJPQLQueryStateObject
to visit
-
visit
public void visit(OrderByItemStateObject stateObject)
Visits the givenOrderByItemStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheOrderByItemStateObject
to visit
-
visit
public void visit(ResultVariableStateObject stateObject)
Visits the givenResultVariableStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheResultVariableStateObject
to visit
-
visit
public void visit(SelectStatementStateObject stateObject)
Visits the givenSelectStatementStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheSelectStatementStateObject
to visit
-
-