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

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

import de.ivu.elect.business.geodata.entity.GeodataOrt;
import de.ivu.elect.business.geodata.boundary.GeodataOrtDAO;
import de.ivu.elect.business.geodata.boundary.GeodataOrtCreateEvent;

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

  @Inject
  protected GeodataOrtDAO dao;

    @Inject
    transient Event<GeodataOrtCreateEvent> createEvent;



  


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

  public void sendCreateEvent(GeodataOrt entity) {
        createEvent.fire(new GeodataOrtCreateEvent(entity));
  }

}
