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

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

import de.ivu.elect.business.wahlvorschlag.entity.ReferendumOption;
import de.ivu.elect.business.wahlvorschlag.boundary.ReferendumOptionDAO;
import de.ivu.elect.business.wahlvorschlag.boundary.ReferendumOptionCreateEvent;

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

  @Inject
  protected ReferendumOptionDAO dao;

    @Inject
    transient Event<ReferendumOptionCreateEvent> createEvent;



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


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

  public void sendCreateEvent(ReferendumOption entity) {
        superCreate.sendCreateEvent(entity);
        createEvent.fire(new ReferendumOptionCreateEvent(entity));
  }

}
