posted 14 years ago
Yes they do. Some people put their annotation on their interfaces.
Based on the code you wrote I have two comments about the abstract class.
1) You are using JPA and injecting the EntityManager, there is absolutely no reason why you need to extend HibernateDaoSupport. You are not gaining anything by it and now you are tightly coupling your code with a Spring specific class.
2) You are putting a bean name in your @Repository annotation, but plan to extend it by many Repository classes, which each will need their own distinct name. Spring will automatically give it a name, and since you are going the route of annotations, then it is assumed you are auto wiring, which spring does by type, so a name besides what Spring automatically generates is enough.
Mark