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

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

import de.ivu.elect.business.person.entity.Kreditinstitut;
import de.ivu.elect.business.person.boundary.KreditinstitutDAO;
import de.ivu.elect.business.person.boundary.KreditinstitutCreateEvent;

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

  @Inject
  protected KreditinstitutDAO dao;

    @Inject
    transient Event<KreditinstitutCreateEvent> createEvent;



  


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

  public void sendCreateEvent(Kreditinstitut entity) {
        createEvent.fire(new KreditinstitutCreateEvent(entity));
  }

}
