cbredesen wrote:
Code:
sessionFactory = new AnnotationConfiguration()
.addPackage("test.animals") //the fully qualified package name
.addAnnotatedClass(Flight.class)
.addAnnotatedClass(Sky.class)
.addAnnotatedClass(Person.class)
.addAnnotatedClass(Dog.class)
.addResource("test/animals/orm.xml")
.buildSessionFactory();
Chapter 1 of the manual!
http://hibernate.org/hib_docs/annotatio ... figurationThanks for the reply.
But my question was how to get a Configuration without considering the Entity classes.
If I use
addAnnotatedClass(...) I destroy the single-point-of-truth. It is not useable to add all entities manually.
Is it possible that the configuration looks itself for all annotated classes?
sessionFactory = new AnnotationConfiguration().buildSessionFactory(); does not work.
Code:
org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
....
I want to get the datasource from the *-ds.xml file.
Bastian