As you can see from the stack trace below, it says that I have a problem with my mapping file. It is saying that orderby is required for a set? According the the documentation, order-by is optional, and only supported with JDK1.4 (currently using 1.3).
Is the mapping for a set element, different than a map element?
Hibernate version: 2.1
Mapping documents: Only showing relevent part:
Code:
...
<set cascade="all" lazy="true" name="clientGroups">
<key column="clientId"/>
<one-to-many class="com.lmig.pm.affinity.model.client.ClientGroup"/>
</set>
...
Code between sessionFactory.openSession() and session.close():I haven't opened the session yet, it is an error in the mapping file when I load the configuration.
Full stack trace of any exception that occurs:Code:
net.sf.hibernate.MappingException: Error reading resource: HibernateConn/mapping.hbm.xml
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:339)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:1013)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:969)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:897)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:883)
at HibernateConn.HibernatePull.<init>(HibernatePull.java:25)
at HibernateConn.HibernatePull.main(HibernatePull.java:33)
Caused by: net.sf.hibernate.MappingException: invalid mapping
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:287)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:336)
... 6 more
Caused by: org.xml.sax.SAXParseException: Attribute "orderby" must be declared for element type "set".
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)(Inlined Compiled Code)
at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source)(Compiled Code)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
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:286)
... 7 more
Name and version of the database you are using:DB2
The generated SQL (show_sql=true):...
Debug level Hibernate log excerpt:...
[/code]