EntityManagerFactory factory = Persistence.createEntityManagerFactory("JamesMigrator");
EntityManager em = factory.createEntityManager();
for (String jira: jiras) {
JpaMigrateCommand jiraJpaMigratable = (JpaMigrateCommand) Class.forName(JPA_MIGRATION_COMMAND_PACKAGE + "." + jira.toUpperCase() + JpaMigrateCommand.class.getSimpleName()).newInstance();
System.out.println("Now executing " + jira + " migration.");
em.getTransaction().begin();
jiraJpaMigratable.migrate(em);
em.getTransaction().commit();
System.out.println(jira + " migration is successfully achieved.");
}
}