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

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

import de.ivu.elect.business.person.entity.Personendaten;
import de.ivu.elect.business.person.boundary.PersonendatenDAO;
import de.ivu.elect.business.person.boundary.PersonendatenCreateEvent;

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

  @Inject
  protected PersonendatenDAO dao;

    @Inject
    transient Event<PersonendatenCreateEvent> createEvent;



  


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

  public void sendCreateEvent(Personendaten entity) {
        createEvent.fire(new PersonendatenCreateEvent(entity));
  }

}
