views:

230

answers:

2

Hi there, When I do a refactoring such as renaming a field in netbeans, the hibernate mapping files are updated accordingly. This could have bean a good thing if the whole files were not completely reformatted. So I would rather not have this feature. Is there a way to disallow the modification of hibernate mapping files by netbeans?

+3  A: 

That is the point of re-factoring, it changes everything in your project to match your new changes. If you don't want files dynamically updated when you re-factor, I suggest you remove them from your project. This will allow you to continue to use the re-factor functionality without mucking up the files you don't want changed.

EDIT: Also, you might want to check this out it is on google books and talks a little bit about netbeans re-factoring.

Robert Greiner
Well if refactoring did to java sources what it does to mapping files: changing indentation, removing blank lines, changing the order of statements, it would be doing much more harm than good and nobody would be using it.
Maurice Perry
agreed, and that's why it doesn't do all of that in my opinion. However, it has been proven that manual processes are very error prone, and any repetitive action that can be automated saves you time/frustration/errors in the long run. That's why (in my mind) the re-factor changes variable names.
Robert Greiner
A: 

You can do regular rename of a field not refactor rename or also when you do refactor rename CTRL+R(by default) you can choose preview and the select all the needed changes ...

Mite Mitreski