Suppose that I have the following HQL:
String hql = "select e.aField from MyEntity as e";
If I want to refactor and change the name of the MyEntity
's member variable aField
to something else, I also have to change all occurrences in the whole code in Strings. If I forget to change one hql string the code breaks.
How can I avoid this from happening?