You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/06/16 10:07:00 UTC

[jira] [Commented] (ARIES-1711) Mapping files in persistence.xml not used

    [ https://issues.apache.org/jira/browse/ARIES-1711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16051718#comment-16051718 ] 

ASF subversion and git services commented on ARIES-1711:
--------------------------------------------------------

Commit 9beff6f42859fc65f6f66e4386cfb24a2920d297 in aries-jpa's branch refs/heads/master from timothyjward
[ https://git-wip-us.apache.org/repos/asf?p=aries-jpa.git;h=9beff6f ]

Support mapping files - Fixes ARIES-1711


> Mapping files in persistence.xml not used
> -----------------------------------------
>
>                 Key: ARIES-1711
>                 URL: https://issues.apache.org/jira/browse/ARIES-1711
>             Project: Aries
>          Issue Type: Bug
>          Components: JPA
>    Affects Versions: jpa-2.7.0, jpa-2.6.1
>         Environment: Apache Aries 2.6.1
> Hibernate 5.0.7.Final
> Felix 5.6.1
> JPA 2.1
>            Reporter: Alexander Liepold
>         Attachments: aries-itest-mapping-files.zip, JPAHandler.patch, PersistenceUnit.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> 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 :
>  
> {code: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>
> {code}
> 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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)