Hello all,
I am using the AnnotationConfiguration object, for the first time, to startup hibernate. The following code does that:
sessionFactory = new AnnotationConfiguration() .addPackage("com.entity") .addAnnotatedClass(Address.class) .addAnnotatedClass(Contact.class) .configure() .buildSessionFactory();
The Address and Contact entities are annotated and are in the com.entity package. The hibernate.cfg.xml file has the following entries:
<hibernate-configuration> <session-factory> <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property> <property name="hibernate.connection.driver_class">org.postgresql.Driver</property> <property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/vj_test</property> <property name="hibernate.connection.username">vj_test</property> <property name="hibernate.connection.password">vj_test</property> <property name="hibernate.hbm2ddl.auto">create</property> </session-factory> </hibernate-configuration>
When I start the server, I can see that the db connection is obtained, but the two tables (Address and Contact) are not created. I gave hibernate.hbm2dll.auto to "true" in the config file. I also see a WARN message in the logs like this:
16:42:29,809 WARN [AnnotationBinder:222] Package not found or wo package-info.java: com.entity
What am I doing wrong here? Please help...i'm stuck with this issue for the last 3 days :(.
thanks
|