use of org.jboss.tools.hibernate.reddeer.jpt.ui.wizard.GenerateEntitiesWizardPage in project jbosstools-hibernate by jbosstools.
the class EntityGenerationFactory method generateJPAEntities.
/**
* Creates JPA entities from database by using Hibernate JPA entity generation facility
* @param cfg database configuration
* @param prj project
* @param pkg package where entities will be located
* @param hbVersion hibernate version
*/
public static void generateJPAEntities(DatabaseConfiguration cfg, String prj, String pkg, String hbVersion, boolean useConsole) {
ProjectExplorer pe = new ProjectExplorer();
pe.open();
pe.selectProjects(prj);
GenerateEntitiesWizard w = new GenerateEntitiesWizard();
w.open();
GenerateEntitiesWizardPage p = new GenerateEntitiesWizardPage(w);
p.setUseConsole(useConsole);
p.setPackage(pkg);
if (!useConsole) {
p.setHibernateVersion(hbVersion);
p.setDatabaseConnection(cfg.getProfileName());
}
w.finish();
}
Aggregations