Class RefactoringTool.EntityNameRenamer
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.EntityNameRenamer
- All Implemented Interfaces:
StateObjectVisitor
- Enclosing class:
RefactoringTool
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
-
Constructor Summary
ConstructorDescriptionEntityNameRenamer
(String oldEntityName, String newEntityName) Creates a newEntityNameRenamer
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
visit
(AbstractSchemaNameStateObject stateObject) Visits the givenAbstractSchemaNameStateObject
.void
visit
(EntityTypeLiteralStateObject stateObject) Visits the givenEntityTypeLiteralStateObject
.void
visit
(IdentificationVariableStateObject stateObject) Visits the givenIdentificationVariableStateObject
.void
visit
(TreatExpressionStateObject stateObject) Visits the givenTreatExpressionStateObject
.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, 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:StateObjectVisitor
Visits the givenAbstractSchemaNameStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheAbstractSchemaNameStateObject
to visit
-
visit
Description copied from interface:StateObjectVisitor
Visits the givenEntityTypeLiteralStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheEntityTypeLiteralStateObject
to visit
-
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 givenTreatExpressionStateObject
.- Specified by:
visit
in interfaceStateObjectVisitor
- Overrides:
visit
in classAnonymousStateObjectVisitor
- Parameters:
stateObject
- TheTreatExpressionStateObject
to visit
-