On Play Framework 1.2.5 with Jpa+Hibernate as ORM, I would like to call programmatically Hibernate tool SchemaExport. I tried this code:
Ejb3Configuration cfg = getPlayEjb3Configuration();
Configuration configuration = cfg.getHibernateConfiguration();
try {
SchemaExport se = new SchemaExport(configuration);
se.setHaltOnError(true);
se.setDelimiter(";").setFormat(true);
se.execute(true, false, false, false);
}
catch(Exception e) {
…
}Where getPlayEjb3Configuration() is a "copy" of play framework JPAPlugin.onApplicationStart().
I always obtain a 'no datasource provided' exception message. I try to preserve ejb3 configuration in a static reference (modifying play framework) with no difference in result.
What I do wrong?