Code example for EntityManagerHolder

Methods: getEntityManager

0
	 * Suppression du EntityManager. 
	 */ 
	public void closeEntityManager() { 
		if (TransactionSynchronizationManager.hasResource(entityManagerFactory)) { 
			EntityManagerHolder entityManagerHolder = (EntityManagerHolder) TransactionSynchronizationManager.unbindResource(entityManagerFactory); 
			EntityManagerFactoryUtils.closeEntityManager(entityManagerHolder.getEntityManager()); 
		} 
	} 
	 
	public EntityManager getEntityManager() { 
		return entityManager; 
	} 
}