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

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

import de.ivu.elect.business.person.entity.Tag;
import de.ivu.elect.business.person.boundary.TagDAO;
import de.ivu.elect.business.person.boundary.TagCreateEvent;

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

  @Inject
  protected TagDAO dao;

    @Inject
    transient Event<TagCreateEvent> createEvent;



  


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

  public void sendCreateEvent(Tag entity) {
        createEvent.fire(new TagCreateEvent(entity));
  }

}
