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

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

import de.ivu.elect.business.wahlvorschlag.entity.Liste;
import de.ivu.elect.business.wahlvorschlag.boundary.ListeDAO;
import de.ivu.elect.business.wahlvorschlag.boundary.ListeCreateEvent;

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

  @Inject
  protected ListeDAO dao;

    @Inject
    transient Event<ListeCreateEvent> createEvent;



    @Inject
  de.ivu.elect.business.wahlvorschlag.control.WahlvorschlagCreate superCreate;
  


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

  public void sendCreateEvent(Liste entity) {
        superCreate.sendCreateEvent(entity);
        createEvent.fire(new ListeCreateEvent(entity));
  }

}
