Hello,
I have a problem when asking Hibernate to programmatically recreate the database schema.
If I define this property in hibernate.cfg.xml
Code:
<property name="hbm2ddl.auto">create</property>
Then, this code works ok:
Code:
Configuration config = new Configuration().configure();
SessionFactory sessionFactory = config.buildSessionFactory();
sessionFactory = hibernateConfiguration.buildSessionFactory();
However, if I remove that line from hibernate.cfg.xml
Then, this code does not work ok:
Code:
Configuration config = new Configuration().configure();
config.setProperty("hbm2ddl.auto", "create");
SessionFactory sessionFactory = config.buildSessionFactory();
sessionFactory = hibernateConfiguration.buildSessionFactory();
That is,
if I programmatically ask Hibernate to create the database schema,
Hibernate does not do it.
What can be the problem?
Many thanks,
DAvid