Article:
  Hibernate Class Generation Using hbm2java
Subject:   Using annotation or XDoclet is better
Date:   2006-02-06 14:26:26
From:   Wakaleo
Response to: Using annotation or XDoclet is better

This is often a matter of personal preference: some people will be more confortable writing (and maintaining) the mapping information directly in the Java source code, whereas others prefer centralising the mapping into dedicated mapping files. The first approach may be better if the same person maintains the mappings (including mapping optimisations such as caching), though I personnaly find it harder to read when the mappings are spread through the code in the form of annotations. However, as often is the case, personal preferences are important, and it is often better to use the approach with which you are the most confortable.