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

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

import de.ivu.elect.business.wertelisten.entity.Wertelisten;
import de.ivu.elect.business.wertelisten.boundary.WertelistenDAO;
import de.ivu.elect.business.wertelisten.boundary.WertelistenCreateEvent;

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

  @Inject
  protected WertelistenDAO dao;

    @Inject
    transient Event<WertelistenCreateEvent> createEvent;



  


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

  public void sendCreateEvent(Wertelisten entity) {
        createEvent.fire(new WertelistenCreateEvent(entity));
  }

}
