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

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

import de.ivu.elect.business.kandidatur.entity.Listenkandidatur;
import de.ivu.elect.business.kandidatur.boundary.ListenkandidaturDAO;
import de.ivu.elect.business.kandidatur.boundary.ListenkandidaturCreateEvent;

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

  @Inject
  protected ListenkandidaturDAO dao;

    @Inject
    transient Event<ListenkandidaturCreateEvent> createEvent;



    @Inject
  de.ivu.elect.business.kandidatur.control.KandidaturCreate superCreate;
  


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

  public void sendCreateEvent(Listenkandidatur entity) {
        superCreate.sendCreateEvent(entity);
        createEvent.fire(new ListenkandidaturCreateEvent(entity));
  }

}
