Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "DaliRefactoringParticipants"
(New page: =Refactoring= All our refactorings will be displayed in the refactoring preview dialog and will support Undo as this is part of the framework. Any XML changes will be done without the user...) |
(→Refactoring) |
||
Line 1: | Line 1: | ||
=Refactoring= | =Refactoring= | ||
− | + | *Display changes in the Refactoring preview dialog | |
+ | *Support Undo | ||
+ | *Any XML changes will be done without the user having to check the box 'Update fully qualified names in non-Java text files'. Currently the user can get java type renames to be completed in the persistence.xml by checking that box, but a java type delete will not edit the persistence.xml. | ||
+ | *Support refactorings in 1 project affecting any JpaProject in the workspace | ||
[https://bugs.eclipse.org/209489 bug 209489] | [https://bugs.eclipse.org/209489 bug 209489] |
Revision as of 16:15, 11 June 2010
Contents
Refactoring
- Display changes in the Refactoring preview dialog
- Support Undo
- Any XML changes will be done without the user having to check the box 'Update fully qualified names in non-Java text files'. Currently the user can get java type renames to be completed in the persistence.xml by checking that box, but a java type delete will not edit the persistence.xml.
- Support refactorings in 1 project affecting any JpaProject in the workspace
Java Refactoring Participants
Delete Type
- persistence.xml
- delete class elements from that match the deleted package
- EclipseLink properties - delete if the class matches
- eclipselink.session.customizer
- eclipselink.descriptor.customizer
- eclipselink.logging.logger
- eclipselink.session-event-listener
- orm.xml mappings files
- delete entity/embeddable/mapped-superclass class element
- Package element in an orm.xml - delete it if it matches?
- delete other class references
- id-class element
- element-collection map-key-class
- 1-m/m-m map-key-class
- EclipseLink
- entity/mapped-superclass/embeddable customizer
- entity class-extractor
- entity/mapped-superclass cache-interceptor
Delete Package
- all items from Delete Type - multiple types will be deleted when a package is deleted
- package element in an orm.xml - delete it if it matches?
Rename Type
- persistence.xml
- udpate class elements that match the package to be renamed
- EclipseLink properties - rename if the class matches
- eclipselink.session.customizer
- eclipselink.descriptor.customizer
- eclipselink.logging.logger
- eclipselink.session-event-listener
- orm.xml mapping files
- rename entity/embeddable/mapped-superclass class element
- rename other class references
- id-class element
- element-collection map-key-class
- 1-m/m-m map-key-class
- EclipseLink
- entity/mapped-superclass/embeddable customizer
- entity class-extractor
- entity/mapped-superclass cache-interceptor
Rename Package
- all items from Rename Type
- orm.xml mapping files
- Rename package element - this can be a fragment
Move Type
- all items from Rename Type
Rename Field/Method
- Java
- rename mappedBy
- rename MapsId
- rename MapKey
- rename AttributeOverride name
- rename AssociationOverride name
- Mapping files
- rename corresponding mapping
- rename mapped-by
- rename maps-id
- rename map-key
- rename attribute-override name
- rename association-override name
Push Down
- Java
- Annotations move with the method/field
- What if there are attribute overrides on the subclass for the fields that are being move?
- Remove the attribute overrides?
- Take that metadata and put it on the attribute? what if it is different from what already exists?
- We can check for all of this information in the refactoring participant and decide whether there is anything we can do.
- orm.xml
- we would have to move the mappings to the subclass entity in orm.xml. If the subclass entity does not exist we create it.
Pull Up
Extract Superclass
Extract Class
Mapping File Refactoring
Delete Mapping File
- persistence.xml
- delete mapping-file reference
Rename Mapping File
- persistence.xml
- update mapping-file reference
- Rename the default orm.xml/ecliselink-orm.xml file we could add a reference to it in the persistence.xml if it does not exist
Move Mapping File
JPA DB Metadata Refactoring Participants
We need a JPA project preference for these since it would only apply for someone who is not generating their schema.
- Rename/Move Type
- Add @Table if name is not currently specified(only if it currently matches a table on the database? - would have to be connected)
- Entity name specified - no need to add @Table
- Inheritance SINGLE_TABLE strategy - no need to add @Table if not the root
- Add @Table if name is not currently specified(only if it currently matches a table on the database? - would have to be connected)
- Rename attribute
- Insert @Column if name name is not currently specified
- Insert @JoinColumn
Refactoring Contributions
- Move annotations to xml
- Move xml to annotations