The biggest problem that we have encountered on a regular basis is that if you want to change the display of persistence in any , using only annotations, you need to recompile and redeploy.
Using orm.xml gives you a degree of abstraction, which can make reconfiguration a bit more straightforward and technically achievable with the same code base (for example, you are sure that the line of code has not penetrated the re-compilation / redistribution).
You can use both annotations , and - this is the environment I'm working with right now - classes are annotated with metadata for saving functional type (i.e. foreign keys, unions, etc.) that have a code level representation), while while irrelevant information (i.e. table and column names) is stored in the configuration files.
We are still trying to develop some clear heuristics when we use one configuration mechanism over another, but we get there.
Martin
source share