1 25 package org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.persistenceunitref; 26 27 import static org.objectweb.easybeans.tests.common.helper.ContextHelper.checkEntityManagerFactory; 28 29 import javax.annotation.Resource; 30 import javax.ejb.Remote ; 31 import javax.ejb.SessionContext ; 32 import javax.ejb.Stateless ; 33 import javax.persistence.EntityManagerFactory; 34 import javax.persistence.PersistenceUnit; 35 36 import org.objectweb.easybeans.tests.common.ejbs.base.ItfCheck00; 37 38 43 @Stateless (name = "SLSBPUnitRefMethodInjection00") 44 @Remote (ItfCheck00.class) 45 public class SLSBPUnitRefMethodInjection00 implements ItfCheck00{ 46 47 50 @Resource 51 private SessionContext sessionContext; 52 53 56 private EntityManagerFactory emf00; 57 58 61 private EntityManagerFactory emf01; 62 63 66 private EntityManagerFactory emf02; 67 68 72 @PersistenceUnit(name = "persistence/pu00") 73 public void setPersistenceUnit00(final EntityManagerFactory emf) { 74 emf00 = emf; 75 } 76 77 81 @PersistenceUnit(name = "persistence/pu01", unitName = "testEntity00") 82 public void setPersistenceUnit01(final EntityManagerFactory emf) { 83 emf01 = emf; 84 } 85 86 90 @PersistenceUnit(unitName = "testEntity00") 91 public void setEmf02(final EntityManagerFactory emf) { 92 emf02 = emf; 93 } 94 95 102 public void check() { 103 checkEntityManagerFactory(sessionContext, emf00, "persistence/pu00"); 104 checkEntityManagerFactory(sessionContext, emf01, "persistence/pu01"); 105 checkEntityManagerFactory(sessionContext, emf02, 106 "org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged." 107 + "persistenceunitref.SLSBPUnitRefMethodInjection00/emf02"); 108 } 109 } 110 | Popular Tags |