EntityManagerProducer.java 706 Bytes
package org.legrog.configuration;

import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Produces;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 * JPA configuration class, used by all classes extending JpaRepository
 *
 * No difference made between Integration and Production yet,
 * as there is only one PU in the environnement at a given moment
 */
//@Exclude(ifProjectStage = ProjectStage.IntegrationTest.class)
public class EntityManagerProducer {

    /**
     * Injectable interface for persistence handling
     */
    @Produces @Dependent
    @PersistenceContext(unitName = "Grog-DB")
    public EntityManager entityManager;
    

}