Hibernate version:
2.1.6
Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<!-- TripwireIncident Object-->
<class name="com.waypoint.rs.incident.tripwire.TripwireIncidentObject"
table="RS_TW_INCDT_OBJECT" discriminator-value="OBJECT">
<meta attribute="class-description">
Represents a tripwire incident object
@author Sameet Nasnodkar
</meta>
<id name="id" type="long" column="ID">
<generator class="native"/>
</id>
<property name="name" type="string">
<meta attribute="use-in-tostring">true</meta>
<column name="NAME" not-null="true"/>
</property>
<discriminator column="OBJECT_TYPE" type="string"/>
<subclass name="com.waypoint.rs.incident.tripwire.AddedTripwireIncidentObject"
discriminator-value="ADDED"/>
<subclass name="com.waypoint.rs.incident.tripwire.ChangedTripwireIncidentObject"
discriminator-value="CHANGED"/>
<subclass name="com.waypoint.rs.incident.tripwire.RemovedTripwireIncidentObject"
discriminator-value="REMOVED"/>
<!--many-to-one name="incident" class="com.waypoint.rs.incident.tripwire.TripwireIncident"
column="INCIDENT_ID" not-null="true"/-->
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():N/A
Full stack trace of any exception that occurs: Code:
[hbm2java] (hbm2java.CodeGenerator 48 ) Error parsing XML: file:/
C:/work/waypoint/WaypointRS/dbproject/src/com/waypoint/rs/incident/tripwire/Trip
wireIncidentObject.hbm.xml(39)
[hbm2java] org.xml.sax.SAXParseException: The content of element type "class" m
ust match "(meta*,(cache|jcs-cache)?,(id|composite-id),discriminator?,(version|t
imestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|any|map|
set|list|bag|idbag|array|primitive-array)*,(subclass*|joined-subclass*))".
[hbm2java] at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseExce
ption(Unknown Source)
[hbm2java] at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Sour
ce)
[hbm2java] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown S
ource)
[hbm2java] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown S
ource)
[hbm2java] at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(U
nknown Source)
[hbm2java] at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
Source)
[hbm2java] at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElemen
t(Unknown Source)
[hbm2java] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragmen
tContentDispatcher.dispatch(Unknown Source)
[hbm2java] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDoc
ument(Unknown Source)
[hbm2java] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown So
urce)
[hbm2java] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown So
urce)
[hbm2java] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
[hbm2java] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Sou
rce)
[hbm2java] at org.jdom.input.SAXBuilder.build(SAXBuilder.java:370)
[hbm2java] at org.jdom.input.SAXBuilder.build(SAXBuilder.java:724)
[hbm2java] at org.jdom.input.SAXBuilder.build(SAXBuilder.java:703)
[hbm2java] at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerat
or.java:100)
[hbm2java] at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2J
avaTask.java:145)
[hbm2java] at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaT
ask.java:95)
[hbm2java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:269)
[hbm2java] at org.apache.tools.ant.Task.perform(Task.java:364)
[hbm2java] at org.apache.tools.ant.Target.execute(Target.java:301)
[hbm2java] at org.apache.tools.ant.Target.performTasks(Target.java:328)
[hbm2java] at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
[hbm2java] at org.apache.tools.ant.Project.executeTargets(Project.java:1063
)
[hbm2java] at org.apache.tools.ant.Main.runBuild(Main.java:632)
[hbm2java] at org.apache.tools.ant.Main.startAnt(Main.java:183)
[hbm2java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
[hbm2java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
Name and version of the database you are using:
The generated SQL (show_sql=true):
N/A
Debug level Hibernate log excerpt:
N/A
I am trying to generate code using the table per class hierarchy mechanism for inheratance. I know there is something small that I am missing. Could anyone please point it out to me?