1 25 package org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.persistencectxref; 26 27 import static org.objectweb.easybeans.tests.common.helper.ContextHelper.checkEntityManager; 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.EntityManager; 34 import javax.persistence.PersistenceContext; 35 36 import org.objectweb.easybeans.tests.common.ejbs.base.ItfCheck00; 37 38 39 44 @Stateless (name = "SLSBPCtxRefFieldInjection00") 45 @Remote (ItfCheck00.class) 46 public class SLSBPCtxRefFieldInjection00 implements ItfCheck00{ 47 48 51 @Resource 52 private SessionContext sessionContext; 53 54 57 @PersistenceContext(name = "persistence/pu00") 58 private EntityManager em00; 59 60 63 @PersistenceContext(name = "persistence/pu01", unitName = "testEntity00") 64 private EntityManager em01; 65 66 69 @PersistenceContext(unitName = "testEntity00") 70 private EntityManager em02; 71 72 79 public void check() { 80 checkEntityManager(sessionContext, em00, "persistence/pu00"); 81 checkEntityManager(sessionContext, em01, "persistence/pu01"); 82 checkEntityManager(sessionContext, em02, this.getClass().getName() + "/em02"); 83 } 84 85 } 86 | Popular Tags |