Refactor on Jaxb rename/move
已回答
Hello,
Some of our classes get generated by jaxb from a schema.
Whenever one of those classes changes name (or is moved to a different package), we end up having to manually rename a gazillion imports, type references and field names in our own code.
Is there a way to use IntelliJ's refactoring features when a class' (file) name or location has changed, to get all references in our source code updated painlessly?
Brgrds,
Christian
请先登录再写评论。
Refactoring works automatically for the folders that are configured as sources, test sources or generated sources. Make sure the generated java files are under one of the source roots.
Serge, I think the point is that the _schema_ is changed and the generated classes change automatically due to that.
I don't think IDEA can handle that.
Ah, if the change to the class/name is external (due to the schema changes), IDEA cannot handle it. One can refactor beforehand knowing the new class name/location, and then generate the code.