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

import javax.inject.Inject;
import javax.enterprise.event.Event;

import de.ivu.elect.business.email.entity.EmailVorgang;
import de.ivu.elect.business.email.boundary.EmailVorgangDAO;
import de.ivu.elect.business.email.boundary.EmailVorgangCreateEvent;

// abgeleitete Klasse NICHT mit "@javax.ejb.Stateless" annotieren!
public abstract class AbstractEmailVorgangCreate {

  @Inject
  protected EmailVorgangDAO dao;

    @Inject
    transient Event<EmailVorgangCreateEvent> createEvent;



  


public void save(EmailVorgang entity) {
    dao.persist(entity);
    sendCreateEvent(entity);
  }

  public void sendCreateEvent(EmailVorgang entity) {
        createEvent.fire(new EmailVorgangCreateEvent(entity));
  }

}
