I would say the answer would be ... yes.
In other words, I personally prefer using both. I like using annotations to show relationships, but I would avoid specifying database-specific information in your annotations, like table and column names, for instance.
This will result in some redundant information, which is obviously a disadvantage. It also means that many of your annotations are actually being ignored (entries in the mapping file for a property override the annotations). That's also unfortunate.
If you're trying to use pure JPA (including the mapping specification), you may find situations where you need to use a Hibernate-specific annotation because of some feature that you need. In that case, you may have to comment out the analogous entries in the mapping file (I prefer to do this instead of removing the entry), so the mapping file doesn't override the annotation.
|