Joined: Fri Jul 08, 2016 11:00 am Posts: 1
|
Because ours application have many dependent jar and many entity in each jar component (without use .ear for all application). I can not use inject @PersistenceContext to use common EntityManager for all Entity of jars. I use one peristence.xml to list all Entity in all jar. Then configure bind EntityManager to JNDI with hibernate in peristence.xml :
<property name="jboss.entity.manager.jndi.name" value="java:/entityManager"/> Then i can call EntityManager by JNDI. But i don't know how to bind entityMananger with "PersistenceContextType.EXTENDED" to JNDI. Or others solution to call EntityManager common for all jar in EJB without use JNDI call. I try with @PersistenceContext(xyz.jar#entityManager) but entityManager is always null.
Others question :
I want to separate the configuration of info database in other file configration like database.xml, not in persistence.xml of JPA . But i can not find how to separate the configuration of database in other file configuration with JPA and hibernate. (EJB/JPA/Hibernate environement) You can help me ?
Thanks you for help
|
|