// Add the persistence.xml to the "ear"
appModule.getPersistenceModules().add(new PersistenceModule("root", new Persistence(unit)));
// Configure and assemble the ear -- aka. deploy it
AppInfo info = config.configureApplication(appModule);
assembler.createApplication(info);
}
private void addStatefulBean(EjbJar ejbJar, Class<?> ejbClass, String name, String reference) {
StatefulBean bean = ejbJar.addEnterpriseBean(new StatefulBean(name, ejbClass));
bean.getEjbLocalRef().add(new EjbLocalRef("child", reference));