public class AnnotatedClassesList
extends java.lang.Object
Yes, this is a nuisance. If Hibernate Session class is used instead of the
JPA EntityManager class then all annotated classes have to be explicitly
added to the Configuration object. Don't want to get into using the JPA
EntityManager class for now (just trying to learn Hibernate based on books
such as Harnessing Hibernate). So need to do this.
These annotated classes could also be listed in the hibernate.cfg.xml config
file but that would be difficult to maintain. Each application might already
have a modified hibernate config file. Don't want to have to have each app
modify their config file when new annotated classes are added. Therefore it
is best to configure these classes programmatically.
- Author:
- SkiBu Smith