Yeah, I tried this in hibernate.cfg.xml:
Code:
<hibernate-configuration>
<session-factory>
...
<property name="show_sql">true</property>
...
<mapping resource="example/MyClass.hbm.xml"/>
...
<mapping resource="query.hbm.xml"/>
</session-factory>
</hibernate-configuration>
and this in query.cfg.xml:
Code:
<hibernate-mapping>
<query name="example.MyClass.select.all">
from example.MyClass as myClass
</query>
</hibernate-mapping>
But the XML parser complains:
Code:
org.dom4j.DocumentException: Error on line 65 of document : XML document structures must start and end within the same entity. Nested exception: XML document structures must start and end within the same entity.
at org.dom4j.io.SAXReader.read(SAXReader.java:355)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:273)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:841)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:792)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:732)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:719)
at com.abp.nl.fi.SimpleTest.initHibernate(SimpleTest.java:192)
at com.abp.nl.fi.SimpleTest.<init>(SimpleTest.java:29)
at com.abp.nl.fi.SimpleTest.main(SimpleTest.java:34)
Nested exception:
org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:339)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:273)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:841)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:792)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:732)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:719)
at com.abp.nl.fi.SimpleTest.initHibernate(SimpleTest.java:192)
at com.abp.nl.fi.SimpleTest.<init>(SimpleTest.java:29)
at com.abp.nl.fi.SimpleTest.main(SimpleTest.java:34)
rethrown as net.sf.hibernate.MappingException: Error on line 65 of document : XML document structures must start and end within the same entity. Nested exception: XML document structures must start and end within the same entity.
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:260)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:273)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:841)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:792)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:732)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:719)
at com.abp.nl.fi.SimpleTest.initHibernate(SimpleTest.java:192)
at com.abp.nl.fi.SimpleTest.<init>(SimpleTest.java:29)
at com.abp.nl.fi.SimpleTest.main(SimpleTest.java:34)
Caused by: org.dom4j.DocumentException: Error on line 65 of document : XML document structures must start and end within the same entity. Nested exception: XML document structures must start and end within the same entity.
at org.dom4j.io.SAXReader.read(SAXReader.java:355)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252)
... 8 more
Exception in thread "main"