The lazy = “false” mapping

Using lazy = "false" mappings is a very bad practice, and overrides any possibility to use fetching strategies.

Even if at a certain point something seems to be necessary all the time and lazy = "false" might make sense, the application will evolve and a context will appear in which that thing will not be necessary – unfortunately you will load it even if you don’t want it, because of the mapping. The solution if you are in this situation and you want to solve it is to remove the lazy = "false" mapping and create fetching strategies, but the refactoring can be quite painful.

IT IS YOUR RESPONSABILITY NOT TO CREATE lazy="false" MAPPINGS.

Advertisement

About this entry