I've written an incremental update script for my roo app to change some database properties that are not updated when the app starts with SchamaUpdate. I'd like to drop some tables then run schema update again to rebuild them (to clear old constraints, columns, etc and regenerate a fresh table).
I've googled a bit but I can't work out how to programatically cause SchemaUpdate to run. The closest I get is:
from here: http://hillert.blogspot.co.uk/2010/0...t-feature.html
org.hibernate.ejb.Ejb3Configuration cfg = new org.hibernate.ejb.Ejb3Configuration();
org.hibernate.ejb.Ejb3Configuration configured = cfg.configure(fb.getPersistenceUnitInfo(), fb.getJpaPropertyMap()); org.hibernate.tool.hbm2ddl.SchemaExport schemaExport = new org.hibernate.tool.hbm2ddl.SchemaExport(configured.getHibernateConfiguration());
That results in a hibernate exeption that there is no datasource provided, so now I'm stuck. Any suggestions would be great!