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

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

import de.ivu.elect.business.internet.entity.InternetWidget;
import de.ivu.elect.business.internet.boundary.InternetWidgetDAO;
import de.ivu.elect.business.internet.boundary.InternetWidgetCreateEvent;

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

  @Inject
  protected InternetWidgetDAO dao;

    @Inject
    transient Event<InternetWidgetCreateEvent> createEvent;



  


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

  public void sendCreateEvent(InternetWidget entity) {
        createEvent.fire(new InternetWidgetCreateEvent(entity));
  }

}
