io.github.jeddict.template.service.producer.EntityManagerProducer.ftl Maven / Gradle / Ivy
Go to download
Jeddict is an open source Jakarta EE application development platform that accelerates developers productivity and simplifies development tasks of creating complex entity relationship models.
<#if package??>package ${package};#if>
import jakarta.enterprise.inject.Produces;
import jakarta.enterprise.context.RequestScoped;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
/**
* Producer for injectable EntityManager
*
*/
@RequestScoped
public class EntityManagerProducer {
@PersistenceContext(unitName = "${PU}")
private EntityManager em;
@Produces
public EntityManager getEntityManager(){
return em;
}
}