-->
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.  [ 3 posts ] 
Author Message
 Post subject: Using XML entities to get the list of mappings
PostPosted: Sun Oct 31, 2004 11:47 am 
Newbie

Joined: Thu Aug 28, 2003 12:04 pm
Posts: 10
Location: Montreal / Canada
We use multiple hibernate.cfg.xml for various environments but the list of mapping files are always the same.

Therefore I decided to create a file with all the mapping and use an xml entity to 'import' it in multiple files.

My .cfg.xml files look like this:
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
   "-//Hibernate/Hibernate Configuration DTD 2.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd" [
      <!ENTITY fileList SYSTEM "file:c:/dev/classes/hibernate-allmappings.xml">
      ]>
<hibernate-configuration>
   <session-factory>
      <!-- ************************* HIBERNATE SETTINGS *************************************************-->
      ... ...

      <!-- ************************* DOMAIN OBJECTS ****************************************************-->
      &fileList;

   </session-factory>
</hibernate-configuration>


Note the usage of an xml entity (fileList). This works fine but I have to specify a full path. I would like to be able to specify to the xml parser to look for hibernate-allmappings.xml in the classpath.

Anyone done this successfully?

Thank,
Fran


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 31, 2004 1:19 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can use a custom EntityResolver I suppose


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 31, 2004 3:14 pm 
Newbie

Joined: Thu Aug 28, 2003 12:04 pm
Posts: 10
Location: Montreal / Canada
michael wrote:
You can use a custom EntityResolver I suppose


Thanks for the suggestion.
Anyone already done that?
Or another solution?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.