-->
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: Including files of mapping files in my .cfg.xml file
PostPosted: Wed Feb 15, 2006 1:19 am 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
I want to import groups of mapping files into my .cfg.xml file, so that my apps don't have to manage the mappings from all of my data access jars. I originally envisaged something like this:
Code:
<hibernate-configuration>
  <session-factory>
    <property ... />
    ...

   <mapping resource="..."/>
   <mapping-bundle resource="..."/>
   <mapping-bundle resource="..."/>
  </session-factory>
</hibernate-configuration>
Where a mapping-bundle resource would point to a file containing something like this:
Code:
<hibernate-mapping-bundle>
   <mapping resource="..."/>
   <mapping resource="..."/>
   <mapping resource="..."/>
</hibernate-mapping-bundle>
That is, it would be a cfg.xml file with no configuration properties, just mapping files.

In HHH-1485, Christian suggested that I "Use XML entities for includes. Refer to any XML documentation.". Can anyone expand on that? I thought I was reasonably familiar with XML, but I don't know of any standard way to include the contents of another XML file. If it really is a standard XML thing, then maybe someone can recommend an XML forum that I should check out?

Alternatively, does anyone know of any non-programmatic way of setting up a selection of mappings from a jar, in a way that doesn't require oodles of .cfg.xml editing when the jar changes?


Top
 Profile  
 
 Post subject: xml entities
PostPosted: Thu Feb 16, 2006 4:43 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Search for XML "external entities"
http://www.devx.com/projectcool/Article/19948/0/page/10

Note: the URLs should be resolvable by EntityResolver of your XML parser, you may also supply your own Entity Resolver to the XML parser

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.