-->
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.  [ 4 posts ] 
Author Message
 Post subject: separating mapping files from mapped classes
PostPosted: Thu Dec 15, 2005 2:05 pm 
Regular
Regular

Joined: Wed Sep 10, 2003 2:26 pm
Posts: 56
Location: San Diego, CA
Can mapping files (*.hbm.xml) sit in a jar different from the one containing mapped classes?

I have a library of business objects that is used in two different environments: one running H3 and the other still on H2. I want to use the same business jar in both environments and only drop in the appropriate mappings jar.

This setup has worked for me in a desktop application, but when I try the same under Tomcat, mapping files cannot be found. Is there something about Tomcat's classloaders that may prevent Hibernate from locating the xml files?


Thanks
Dmitry

Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.0.x


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 15, 2005 2:31 pm 
Beginner
Beginner

Joined: Fri Jul 22, 2005 3:35 pm
Posts: 24
Location: Buenos Aires, Argentina
If you use the "resource" attribute then the mapping files are located via the Java resource mechanism, so these files are located as long as they are in the classpath. So I tink it should work...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 15, 2005 2:34 pm 
Regular
Regular

Joined: Wed Sep 10, 2003 2:26 pm
Posts: 56
Location: San Diego, CA
niqueco, i'm not sure which "'resource' attribute" you are referring to. Could you elaborate?

thanks
D.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 15, 2005 2:39 pm 
Beginner
Beginner

Joined: Fri Jul 22, 2005 3:35 pm
Posts: 24
Location: Buenos Aires, Argentina
I was referring to the mapping element of hibernate.cfg.xml, but this is not useful to you, because you need a differente configuration for that old hibernate... =)

Anyway, everything is located with resources... I don't know what are you wanting to do exactily, but separating the .class from the mappings should make no difference.


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