So this is a bit of an interesting one.
Essentially what I'm trying to do is get implicit polymoprhism working,
but the core of the issue is that I cannot get this include to work in my hbmxml file.
A good example here:
https://forum.hibernate.org/viewtopic.php?f=1&t=998412&p=2415211#p2415211
I have the following (also attached test bed to email, if that will work) CFCs with hbmxml files:
Base.cfc
--------------------------------------------------------------------------------------
component mappedSuperClass="true"
{
property name="id" type="numeric";
}
Base.hbmxml
--------------------------------------------------------------------------------------
<id name="id" type="int">
<column name="id"/>
<generator class="native"/>
</id>
User.cfc
--------------------------------------------------------------------------------------
component extends="Base" persistent="true"
{
property name="name" type="string";
}
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
[ <!ENTITY common SYSTEM "Base.hbmxml"> ]
>
<hibernate-mapping>
<class entity-name="User" lazy="true"
name="cfc:mappedSuper.com.User" table="`User`">
&common;
<property name="name" type="string">
<column name="name"/>
</property>
</class>
</hibernate-mapping>
In theory, this should work, and include the XML from Base.hbmxml into my User.hbmxml file, but it doesn't want to validate. I get the following error:
Document root element "id", must match DOCTYPE root
"null".
org.xml.sax.SAXParseException: Document root element "id", must match DOCTYPE root "null".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source)
Turning on DEBUG level logging I can see:
09/15 09:51:26 [jrpp-7] HIBERNATE DEBUG - trying to resolve system-id [
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
09/15 09:51:26 [jrpp-7] HIBERNATE DEBUG - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
09/15 09:51:26 [jrpp-7] HIBERNATE DEBUG - located [
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
09/15 09:51:26 [jrpp-7] HIBERNATE DEBUG - trying to resolve system-id [file:/mnt/hgfs/wwwroot/test/mappedSuper/com/Base.hbmxml]
09/15 09:51:26 Error [jrpp-7] - Document root element ""id"", must match DOCTYPE root ""null"". The specific sequence of files included or processed is: /mnt/hgfs/wwwroot/test/mappedSuper/index.cfm''
So it is resolving the include (which I can also see if mess around with it to get different errors), but for whatever reason, it doesn't think it's valid XML.
Anyone got any clever ideas? I'm at a loss.
Mark
--
E:
mark....@gmail.comT:
http://www.twitter.com/neuroticW:
www.compoundtheory.com
cf.Objective(ANZ) - Nov 18, 19 - Melbourne Australia
http://www.cfobjective.com.auHands-on ColdFusion ORM Training
www.ColdFusionOrmTraining.com