-->
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: Can Mapping Docs import mappings from another file?
PostPosted: Tue Aug 10, 2004 11:48 am 
Newbie

Joined: Tue Aug 10, 2004 11:36 am
Posts: 3
Location: PA, USA
Hibernate version: 2.1.5

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

Debug level Hibernate log excerpt:

I was wondering if there is a way to import xml mappings from one document into another mapping? What I would like to do is set up a base set of classes that have columns that do not change. I would then like to set my extended mappings up in another mapping document and these would, in a sence, be merged into the class. Also, if this is possible, would I be able to override a mapping in the base set of class mappings with one in the extended set of mappings. ie. change a varchar(32) to varchar(64), etc.?

Thanks for your help.

Dan


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 10, 2004 2:49 pm 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
AFAIK you have two possibilities:

- Do all the changes you want to do using xerxes and finally fead the resulting Document into the Configuration.addDocument() method.
- Feed the original hbm.xml file to Configuration, then call configuration.getClassMapping and apply your changes.

Especially in the second case you have to (re)create your session factory afterwards.

HTH
Ernst


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.