package de.ivu.elect.business.mandant.control;

import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.enterprise.inject.Specializes;
import javax.inject.Inject;

import de.ivu.elect.business.gebietsbaum.boundary.DefaultGebietsarteigenschaftCreator;
import de.ivu.elect.business.mandant.entity.Mandant;

@Stateless
@Specializes
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public class CoreMandantPostCreateActions extends MandantPostCreateActions {

  @Inject
  private transient DefaultGebietsarteigenschaftCreator defaultGebietsarteigenschaftCreator;

  @Override
  protected void init(Mandant mandant) {
    super.init(mandant);
    defaultGebietsarteigenschaftCreator.initGebietsartenGebietsarteigenschaften(mandant);
    mandantDAO.flush();
  }
}
