-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Mixing JPA orm.xml with hibernate's xml
PostPosted: Tue Feb 03, 2009 1:06 pm 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
Hi,

I have following problem. As our application should be as much JPA-compliant as possible, it is necessary to map all entities in a orm.xml with JPA-namespace (xmlns="http://java.sun.com/xml/ns/persistence/orm").
As some very useful hibernate-functions (filters) are not supported by JPA, I have to declare them separately. I know, that I can mix Annotations with XML-mappings to achieve this, but I am wondering if it's possible using another xml-file, which supplements the JPA-xml. Does anyone know, if that is possible?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 18, 2009 11:28 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
Maybe I was unclear, I want to do something like:
orm.xml
Code:
<entity-mappings version="1.0" xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd ">
   <entity class="MyClass"  metadata-complete="false">
            here I can map standard JPA functionality, but not for example fitlers.
   </entity>
</entity-mappings>

+
someOther.hbm.xml
Code:
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
   <class name="MyClass">
             map additional hibernate functions like filters
   </class>
</hibernate-mapping>


So I want two mapping-xmls, which both should be used. Is this possible? Could I do something else besides Annotations?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.