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

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

import de.ivu.elect.business.mandant.entity.AbstractMandant;
import de.ivu.elect.business.mandant.entity.Mandant;

@Stateless
public class SystemMandantFinder {

  @Inject
  private transient MandantDAO mandantDAO;

  @Deprecated // handle with care
  @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
  public Mandant findUnattachedSystemMandant() {
    return AbstractMandant.getSystemMandant(mandantDAO);
  }

  public Mandant findSystemMandant() {
    return AbstractMandant.getSystemMandant(mandantDAO);
  }
}
