I have the following:
PRoviderHistory
--------------------
ProviderIdentifier (not unique (pk))
HistoryCreateUser (pk)
HistoryCreateDateTIme (pk)
I need this mapped and composite-id is giving me errors.
Hibernate version: 3.2.0.g
Mapping documents:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping
>
<class
name="org.delta.provider.npi.data.ProviderHistory"
table="PROVIDERHISTORY"
polymorphism="explicit"
>
<cache usage="read-write" />
<id
name="providerIdentifier"
column="PROVIDERIDENTIFIER"
type="long"
>
<generator class="provided">
</generator>
</id>
<composite-id>
<key-property
name="providerIdentifier"
type="long"
column="PROVIDERIDENTIFIER"/>
<key-property
name="historyCreateUser"
type="java.lang.String"
column="HISTORYCREATEUSER"/>
<key-property
name="historyCreateDateTime"
type="java.util.Date"
column="HISTORYCREATEDATETIME"/>
</composite-id>
<property
name="providerIdentifier"
type="long"
update="false"
insert="false"
column="PROVIDERIDENTIFIER"
unique="false"
/>
<property
name="firstName"
type="java.lang.String"
update="true"
insert="true"
column="PROVIDERFIRSTNAME"
/>
<property
name="lastName"
type="java.lang.String"
update="true"
insert="true"
column="PROVIDERLASTNAME"
/>
<property
name="middleName"
type="java.lang.String"
update="true"
insert="true"
column="PROVIDERMIDDLENAME"
/>
<property
name="facilityName"
type="java.lang.String"
update="true"
insert="true"
column="FACILITYNAME"
/>
<property
name="facilityNumber"
type="java.lang.String"
update="true"
insert="true"
column="FACILITYNUMBER"
/>
<property
name="addressLine1"
type="java.lang.String"
update="true"
insert="true"
column="ADDRESSLINE1"
/>
<property
name="addressLine2"
type="java.lang.String"
update="true"
insert="true"
column="ADDRESSLINE2"
/>
<property
name="city"
type="java.lang.String"
update="true"
insert="true"
column="CITY"
/>
<property
name="stateCode"
type="java.lang.String"
update="true"
insert="true"
column="STATECODE"
/>
<property
name="zipCode"
type="java.lang.String"
update="true"
insert="true"
column="ZIPCODE"
/>
<property
name="planCode"
type="java.lang.String"
update="true"
insert="true"
column="PLANCODE"
/>
<property
name="systemIdentifier"
type="java.lang.String"
update="true"
insert="true"
column="SYSTEMIDENTIFIER"
/>
<property
name="taxIdentifier"
type="java.lang.String"
update="true"
insert="true"
column="TAXIDENTIFIER"
/>
<property
name="individualIdentifier"
type="java.lang.String"
update="true"
insert="true"
column="INDIVIDUALPROVIDERIDENTIFIER"
/>
<property
name="officeIdentifier"
type="java.lang.String"
update="true"
insert="true"
column="OFFICEPROVIDERIDENTIFIER"
/>
<property
name="businessIdentifier"
type="java.lang.String"
update="true"
insert="true"
column="BUSINESSPROVIDERIDENTIFIER"
/>
<property
name="baseLicenseNumber"
type="java.lang.String"
update="true"
insert="true"
column="BASELICENSENUMBER"
/>
<property
name="baseLicenseStateCode"
type="java.lang.String"
update="true"
insert="true"
column="BASELICENSESTATECODE"
/>
<property
name="clientCode"
type="java.lang.String"
update="true"
insert="true"
column="CLIENTCODE"
/>
<property
name="specialtyCode"
type="java.lang.String"
update="true"
insert="true"
column="SPECIALTYCODE"
/>
<property
name="specialtyType"
type="java.lang.String"
update="true"
insert="true"
column="SPECIALTYTYPE"
/>
<property
name="logicalDeleteFlag"
type="int"
update="true"
insert="true"
column="LOGICALDELETEFLAG"
/>
<property
name="updateUser"
type="java.lang.String"
update="true"
insert="true"
column="UPDATEUSER"
/>
<property
name="updateDateTime"
type="java.util.Date"
update="true"
insert="true"
column="UPDATEDATETIME"
/>
<property
name="historyCreateUser"
type="java.lang.String"
update="true"
insert="true"
column="HISTORYCREATEUSER"
/>
<property
name="historyCreateDateTime"
type="java.util.Date"
update="true"
insert="true"
column="HISTORYCREATEDATETIME"
/>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:Code:
Caused by: org.xml.sax.SAXParseException: The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|comp
osite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idba
g|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-qu
ery)*)".
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.handleEndElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(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.DTDConfiguration.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.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:339)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:460)
... 169 more
Name and version of the database you are using: Oracle 10g
[/code]