Uploaded image for project: 'Aries'
  1. Aries
  2. ARIES-1711

Mapping files in persistence.xml not used

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • jpa-2.7.0, jpa-2.6.1
    • jpa-2.7.0
    • JPA
    • None
    • Apache Aries 2.6.1
      Hibernate 5.0.7.Final
      Felix 5.6.1
      JPA 2.1

    • Patch, Important

    Description

      The mapping files in a PeristenceUnit are not used by Apache Aries.

      The same issue was noticed at this thread: http://karaf.922171.n3.nabble.com/Aries-JPA-2-3-0-mapping-file-not-used-td4047501.html

      I have the same problem and I found out that the use of a mapping file in a persistence.xml works only on particular circumstances.

      For example if I use the following declaration of a persistence.xml :

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence ...
      	version="2.1">
      	<persistence-unit name="jpa.customer"
      		transaction-type="RESOURCE_LOCAL">
      		<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
      
      		<non-jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/testDB)</non-jta-data-source>
      
      		<mapping-file>META-INF/developer-orm.xml</mapping-file>
      		
      		<mapping-file>META-INF/orm.xml</mapping-file>
      		
      		<class>test.Customer</class>
      
      		...
      
      		<properties>
      			...
      		</properties>
      	</persistence-unit>
      </persistence>
      

      On deployment of this persistence-unit the class test.Customer gets bootstrapped from Hibernate. The mapping file META-INF/orm.xml is detected automatically from the persistence provider.
      But the mapping file META-INF/developer-orm.xml is never detected.

      If I fixed the particular code in the module Aries JPA Container locally. After building and testing the Apache Aries Project I could deploy a persistence.xml with multiple mapping files.

      Attachments

        1. aries-itest-mapping-files.zip
          22 kB
          Alexander Liepold
        2. JPAHandler.patch
          0.7 kB
          Alexander Liepold
        3. PersistenceUnit.patch
          1 kB
          Alexander Liepold

        Activity

          People

            timothyjward Timothy James Ward
            Alexander Liepold Alexander Liepold
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified