-->
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: Using mappings stored in a JAR package?
PostPosted: Mon Dec 11, 2006 10:59 am 
Newbie

Joined: Mon Sep 18, 2006 9:23 am
Posts: 4
Location: Durham, UK
[ Apologies if this is a standard question! It seems to me that it should be, but if so I haven't been typing in the right search terms to find information on it! ]

I'm writing an object model for scientific data, which I want several applications to be able to use. For example, there is a web application which will use Hibernate and the object model to perform searches on the database and then present the data. There is also another web application which has no interest in data formatting, but wants to use the values for comparison against simulations. Finally, there is a command-line based tools for importing data into the system, which will also be using Hibernate and the object model.

I want to allow all these applications (and maybe more) to use my Hibernate mappings, without each having to "own" a local copy of the mapping files. At the moment I have one JAR for the object model (with no database specific code in it) and a separate JAR for the Hibernate mappings and some db utility methods --- can the client applications (web or otherwise) use the mapping files in the JAR to define how they use Hibernate? For example, if each application has a hibernate.cfg.xml file, is there a special path that needs to be used to tell them to read the mapping files from a JAR dependency rather than from the local run path?

Thanks!
Andy


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 11, 2006 11:21 am 
Regular
Regular

Joined: Wed Mar 23, 2005 8:43 am
Posts: 105
Location: Moscow, Russia
As i know, Hibernate search mapping files in classpath. So if you put your jars anywhere in classpath of your web application (for example in /WEB-INF/lib subdirectory) Hibernate can use them.

_________________
Best Regards


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.