Search in sources :

Example 1 with GenerateEntitiesWizardPage

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();
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) GenerateEntitiesWizard(org.jboss.tools.hibernate.reddeer.jpt.ui.wizard.GenerateEntitiesWizard) GenerateEntitiesWizardPage(org.jboss.tools.hibernate.reddeer.jpt.ui.wizard.GenerateEntitiesWizardPage)

Aggregations

ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)1 GenerateEntitiesWizard (org.jboss.tools.hibernate.reddeer.jpt.ui.wizard.GenerateEntitiesWizard)1 GenerateEntitiesWizardPage (org.jboss.tools.hibernate.reddeer.jpt.ui.wizard.GenerateEntitiesWizardPage)1