views:

29

answers:

0

This is happening in hibernate, but not a hibernate problem. I'm seeing this with the default XML editor for Netbeans 6.9

We do a little trick to avoid a bunch of boiler plate in our hibernate files:

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
[
   <!ENTITY my-boiler-plate SYSTEM "classpath://foo/some.xml.fragment">
]
>

Later in the hbm.xml file, we can do like:

&my-boiler-plate;

And it is interpreted as being the contents of the some.xml.fragment resource.

Netbeans apparently doesn't trust me and occassionally rips out the &my-boiler-plate; as well as changing the ENTITY bit to:

<!ENTITY my-boiler-plate UNKNOWN>]>

How do I stop it from doing this? The classpath resource is in a library jar in which we keep such boiler plate, so netbeans may not know about it until runtime.

If not clear already, this all works correctly when actually running. Hibernate interprets the &my-boiler-plate; entry as we intend. Until netbeans stomps on it.