Possibility to improve hbm.xml Mapping file configuration

Description

My project is having a lot of hbm.xml files in which most of the hbm.xml files are having same component configuration.
Problem is if add/remove a member which should be reflected under database leads to update all hbm.xml files where it is configured.

I can make it as a separate entity and I can proceed. Other than this solution, is there any other solution.

If not, why can't NH allow to use <xi:include href="filename"/> concept. Providing separate xml file for component and ref the xml file where it is required.
Future changes requires to change only one xml file which will reduce all refered xml files update.

Please find the attached sample xml files.

Environment

None

Attachments

2

Activity

Show:

Fabio Maulo 
May 9, 2011 at 3:44 PM

Problem solved by mapping-by-code.

Fabio Maulo 
October 15, 2009 at 9:09 AM

But the !DOCTYPE should be locked by XSD validation

OrenE 
August 18, 2009 at 4:22 AM

Take a look at what XML entities are, they are a way to import some XML from another file.
It looks somewhat like this:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" [
<!ENTITY usageTracking SYSTEM "file:./UsageTrackingComponent.xml">
]>

<hibernate-mapping>
<!-- CVS: $Id: DynamicEnum.hbm.xml,v 1.3 2004/01/19 03:57:29 eepstein Exp $ -->

<class
name="com.publishworks.common.DynamicEnum"
table="dynamic_enum"
schema="common"
>

&usageTracking;

</class>
</hibernate-mapping>

BNReddy 
August 18, 2009 at 3:25 AM

From where can I get MyComponent.

OrenE 
August 13, 2009 at 11:41 AM

This is actually already there, in the sense of XML entities

&MyComponent;

Won't Fix

Details

Assignee

Reporter

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created August 7, 2009 at 5:45 AM
Updated May 9, 2011 at 3:44 PM
Resolved May 9, 2011 at 3:44 PM
Who's Looking?