Class BasicRefactoringTool.EntityNameRenamer
java.lang.Object
org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
org.eclipse.persistence.jpa.jpql.parser.AbstractTraverseChildrenVisitor
org.eclipse.persistence.jpa.jpql.tools.BasicRefactoringTool.AbstractRenamer
org.eclipse.persistence.jpa.jpql.tools.BasicRefactoringTool.EntityNameRenamer
- All Implemented Interfaces:
ExpressionVisitor
- Enclosing class:
BasicRefactoringTool
This visitor renames an entity name. There are three possible
StateObjects
that can represent an entity name:
-
AbstractSchemaNameStateObject
: Employee in
SELECT e
FROM Employee e
-
EntityTypeLiteralStateObject
: Exempt in
SELECT CASE TYPE(e) WHEN Exempt THEN 'Exempt' ELSE 'NONE' END FROM Employee e
-
IdentificationVariableStateObject
: Exempt in
SELECT e FROM Employee e WHERE TYPE(e) <> Exempt
-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
The current name of the entity to rename.protected final String
The new name of the entity.Fields inherited from class org.eclipse.persistence.jpa.jpql.tools.BasicRefactoringTool.AbstractRenamer
textEdits
-
Constructor Summary
ConstructorDescriptionEntityNameRenamer
(String oldEntityName, String newEntityName) Creates a newEntityNameRenamer
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
visit
(AbstractSchemaName expression) Visits theAbstractSchemaName
expression.void
visit
(EntityTypeLiteral expression) Visits theEntityTypeLiteral
expression.void
visit
(IdentificationVariable expression) Visits theIdentificationVariable
expression.Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.BasicRefactoringTool.AbstractRenamer
addTextEdit, addTextEdit, buildTextEdit, reposition
Methods inherited from class org.eclipse.persistence.jpa.jpql.parser.AbstractTraverseChildrenVisitor
visit
Methods inherited from class org.eclipse.persistence.jpa.jpql.parser.AnonymousExpressionVisitor
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, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Field Details
-
newEntityName
The current name of the entity to rename. -
oldEntityName
The new name of the entity.
-
-
Constructor Details
-
EntityNameRenamer
Creates a newEntityNameRenamer
.- Parameters:
oldEntityName
- The current name of the entity to renamenewEntityName
- The new name of the entity
-
-
Method Details
-
visit
Description copied from interface:ExpressionVisitor
Visits theAbstractSchemaName
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theEntityTypeLiteral
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-
visit
Description copied from interface:ExpressionVisitor
Visits theIdentificationVariable
expression.- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classAnonymousExpressionVisitor
- Parameters:
expression
- TheExpression
to visit
-