I've got a DB table with a four-column key:
CaseNumber
DateIssued
TimeIssued
SequenceNbr
I'd like to combine the DateIssued and TimeIssued columns into a single field in my Java class using a UserType.
Here's the mapping from my hbm.xml file for that class:
Code:
<hibernate-mapping>
<class name="net.hctx.jp.hibernate.CaseDocumentHistory" table="CCDOCHP">
<composite-id>
<key-property column="OPN4CF" length="12" name="caseNumber" type="string" />
<key-property name="dateIssued" type="net.hctx.jp.hibernate.SynonDateTimeType">
<column name="OPXADT" length="7"/>
<column name="OPBZTM" length="6"/>
</key-property>
<key-property column="OPPQNE" length="4" name="documentSequenceNumber" type="short" />
</composite-id>
<property column="OPN5CF" length="12" name="documentID" not-null="true" type="string" />
<property column="OPVOCF" length="10" name="userIssuing" not-null="true" type="string" />
<property column="OPKCTV" length="35" name="primaryPartyName" not-null="true" type="string" />
</class>
</hibernate-mapping>
When I attempt to load this class, I get the following error:
Code:
org.hibernate.MappingException: identifier mapping has wrong number of columns: net.hctx.jp.hibernate.CaseDocumentHistory type: component[caseNumber,dateIssued,documentSequenceNumber]
org.hibernate.mapping.RootClass.validate(RootClass.java:194)
org.hibernate.cfg.Configuration.validate(Configuration.java:984)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1169)
net.hctx.jp.hibernate.util.HibernateUtil.createSessionFactory(HibernateUtil.java:34)
org.apache.jsp.CaseInfo.CaseInfo_jsp._jspService(CaseInfo_jsp.java:104)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
Any idea where to begin on this one?
Thanks,
Curt