for (EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
StringTemplate template = deploymentIdTemplate;
org.apache.openejb.api.EjbDeployment annotation = getEjbDeploymentAnnotation(ejbModule, bean);
EjbDeployment ejbDeployment = openejbJar.getDeploymentsByEjbName().get(bean.getEjbName());
if (ejbDeployment == null) {
ejbDeployment = new EjbDeployment();
ejbDeployment.setEjbName(bean.getEjbName());
if (annotation != null && isDefined(annotation.id())) {
template = new StringTemplate(annotation.id());
ejbDeployment.setDeploymentId(formatDeploymentId(bean, contextData, template));
} else {
ejbDeployment.setDeploymentId(formatDeploymentId(bean, contextData, template));
logger.info("Auto-deploying ejb " + bean.getEjbName() + ": EjbDeployment(deployment-id=" + ejbDeployment.getDeploymentId() + ")");
}
openejbJar.getEjbDeployment().add(ejbDeployment);
} else if (ejbDeployment.getDeploymentId() == null) {
if (annotation != null && isDefined(annotation.id())) {
template = new StringTemplate(annotation.id());
ejbDeployment.setDeploymentId(formatDeploymentId(bean, contextData, template));
} else {
ejbDeployment.setDeploymentId(formatDeploymentId(bean, contextData, template));
logger.info("Auto-assigning deployment-id for ejb " + bean.getEjbName() + ": EjbDeployment(deployment-id=" + ejbDeployment.getDeploymentId() + ")");
}
}
if (ejbDeployment.getContainerId() == null && annotation != null && isDefined(annotation.container())) {
ejbDeployment.setContainerId(annotation.container());
}
if (isCmpEntity(bean)) {
EntityBean entity = (EntityBean) bean;
if (entity.getAbstractSchemaName() == null) {