I have the following project structure :-
1. CommonGlobal module which is using hibernate without JPA and which has mainly the global objects which will be used in other modules. Here it is important to mention that this module is working fine independently. The hbm files for these BDOs are in a jar file put in lib folder of EAR.
2. MainModule which is using JPA 2.0 with hibernate 4.1. This module will use the BDO from CommonGlobal module. I had done with the mapping in persistentence.xml like the following :-
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/ ... ce_2_0.xsd" version="2.0">
<persistence-unit name="main-jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>MAINDS</jta-data-source>
<shared-cache-mode>NONE</shared-cache-mode>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect" />
<property name="java.naming.factory.initial" value="weblogic.jndi.WLInitialContextFactory" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.WeblogicTransactionManagerLookup" />
<property name="hibernate.transaction.factory_class"
value="org.hibernate.transaction.CMTTransactionFactory"/>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.archive.autodetection" value="class"/>
</properties>
</persistence-unit>
<persistence-unit name="COMMNPU" transaction-type="JTA">
<jta-data-source>COMMNDS</jta-data-source>
<properties>
<property name="hibernate.ejb.cfgfile" value="/common-hibernate.cfg.xml" />
<property name="hibernate.archive.autodetection" value="" />
</properties>
</persistence-unit>
As shown in persistence unit code above, I had given the hibernate cfg file of commonmodule in separate persisitence unit in same file. This persistence.xml file I am putting in Meta-inf of a jar which is in EAR file. All BDOs(annotated for MAINMODULE ) classes are in other jars put in lib folder.
Now the problem I am facing is that the BDOs of common module are visible to entitymanager but I am not able to get the (annotated) BDOs of MainModule. Where I am doing wrong ?