package de.ivu.elect.jee.entity;

import java.io.Serializable;

import javax.annotation.PostConstruct;
import javax.enterprise.context.RequestScoped;
import javax.persistence.FlushModeType;

/**
 * Hilfsklasse für ELECT-7845 in EntityDAO.vm
 */
@RequestScoped
public class SimpleDAO implements Serializable {

  private static final long serialVersionUID = 1L;

  @javax.persistence.PersistenceContext
  private transient javax.persistence.EntityManager entityManager;

  public javax.persistence.EntityManager getEntityManager() {
    return entityManager;
  }

  @PostConstruct
  public void init() {
    entityManager.setFlushMode(FlushModeType.COMMIT);
  }

}
