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

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

import de.ivu.elect.business.email.entity.EmailLayout;
import de.ivu.elect.business.email.boundary.EmailLayoutDAO;
import de.ivu.elect.business.email.boundary.EmailLayoutCreateEvent;

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

  @Inject
  protected EmailLayoutDAO dao;

    @Inject
    transient Event<EmailLayoutCreateEvent> createEvent;



  


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

  public void sendCreateEvent(EmailLayout entity) {
        createEvent.fire(new EmailLayoutCreateEvent(entity));
  }

}
