I have a database table that uses 8 columns as a primary key, so I'm declaring a composite-id. Any ideas on what's wrong? I try adding the not-null property, but it didn't make a difference. TIA.
Hibernate version:
2.1
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="converter.Psched" table="PSCHED">
<composite-id>
<key-property name="study" column="STUDY" type="string"/>
<key-property name="patid"/>
<key-property name="step"/>
<key-property name="ver"/>
<key-property name="fname"/>
<key-property name="keyval"/>
<key-property name="seq"/>
<key-property name="tdate" type="calendar"/>
</composite-id>
<property name="sname">
<column name="SNAME" type="string" length="50" not-null="true"/>
</property>
<property name="vtitle"/>
<property name="keyunt"/>
<property name="winunt"/>
<property name="winval"/>
<property name="ddate" type="calendar"/>
<property name="req"/>
<property name="reason"/>
<property name="comp"/>
<property name="sysdat" type="calendar"/>
<property name="dchng" type="calendar"/>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:
13:45:09,937 INFO Environment:478 - Hibernate 2.1.7
13:45:09,953 INFO Environment:507 - hibernate.properties not found
13:45:09,953 INFO Environment:538 - using CGLIB reflection optimizer
13:45:09,953 INFO Environment:567 - using JDK 1.4 java.sql.Timestamp handling
13:45:09,968 INFO Configuration:900 - configuring from resource: /hibernate.cfg.xml
13:45:09,968 INFO Configuration:872 - Configuration resource: /hibernate.cfg.xml
13:45:10,625 INFO Configuration:331 - Mapping resource: hib/Psched.hbm.xml
13:45:10,843 INFO Binder:230 - Mapping class: converter.Psched -> PSCHED
13:45:11,359 INFO Configuration:331 - Mapping resource: hib/T_ddmiss.hbm.xml
13:45:11,437 ERROR XMLHelper:48 - Error parsing XML: XML InputStream(11) Attribute "not-null" must be declared for element type "key-property".
13:45:11,437 ERROR XMLHelper:48 - Error parsing XML: XML InputStream(12) Attribute "not-null" must be declared for element type "key-property".
13:45:11,437 ERROR XMLHelper:48 - Error parsing XML: XML InputStream(13) Attribute "not-null" must be declared for element type "key-property".
13:45:11,437 ERROR XMLHelper:48 - Error parsing XML: XML InputStream(14) Attribute "not-null" must be declared for element type "key-property".
13:45:11,437 ERROR XMLHelper:48 - Error parsing XML: XML InputStream(15) Attribute "not-null" must be declared for element type "key-property".
13:45:11,437 ERROR XMLHelper:48 - Error parsing XML: XML InputStream(16) Attribute "not-null" must be declared for element type "key-property".
13:45:11,437 ERROR XMLHelper:48 - Error parsing XML: XML InputStream(17) Attribute "not-null" must be declared for element type "key-property".
net.sf.hibernate.MappingException: Error reading resource: hib/T_ddmiss.hbm.xml
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:339)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:1018)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:974)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:902)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:888)
at converter.ConvertToLegacy.<init>(ConvertToLegacy.java:38)
at converter.ConvertToLegacy.main(ConvertToLegacy.java:30)
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 "not-null" must be declared for element type "key-property".
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.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(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.DTDConfiguration.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
java.lang.NullPointerException
at converter.ConvertToLegacy.convert(ConvertToLegacy.java:51)
at converter.ConvertToLegacy.main(ConvertToLegacy.java:31)
Exception in thread "main"
Name and version of the database you are using:
Ingres II 2.6
|