Hi All,
I and having a problem with my mapping.
Invalid Cast (check your mapping for property type mismatches); setter of NISG.Framework.PatientModule.Domain.Classes.PatientElectronicContact
below is the mapping file:
Code:
<class name="NISG.Framework.PatientModule.Domain.Classes.Patient, NISG.Framework.PatientModule.Domain" table="tbl_patients" lazy="false">
<id name="Id"
type="System.Guid"
column="patient_id">
<generator class="guid.comb"/>
</id>
<property name="DateOfBirth" column="date_of_birth"/>
<property name="DateOfDeath" column="date_of_death"/>
<property name="GenderAtBirth" column="gender_at_birth"/>
<property name="MaritalStatus" column="marital_status"/>
<property name ="CurrentGender" column="current_gender"/>
<bag name="Names" cascade="all-delete-orphan" inverse="true" lazy="false">
<key column="patient_id" />
<one-to-many class="NISG.Framework.PatientModule.Domain.Classes.PatientName, NISG.Framework.PatientModule.Domain" />
</bag>
<bag name="PatientIdentifiers" cascade="all-delete-orphan" inverse="true" lazy="false">
<key column="patient_id"/>
<one-to-many class="NISG.Framework.PatientModule.Domain.Classes.PatientIdentifier, NISG.Framework.PatientModule.Domain"/>
</bag>
<bag name="Addresses" cascade="all" inverse="true" lazy="false">
<key column="patient_id"/>
<one-to-many class="NISG.Framework.PatientModule.Domain.Classes.PatientAddress, NISG.Framework.PatientModule.Domain"/>
</bag>
<bag name="AssociatedPeople" cascade="all-delete-orphan" inverse="true" lazy="false">
<key column="patient_id"/>
<one-to-many class="NISG.Framework.PatientModule.Domain.Classes.AssociatedPerson, NISG.Framework.PatientModule.Domain"/>
</bag>
<bag name="TelephoneNumbers" cascade="all-delete-orphan" inverse="true" lazy="false">
<key column="patient_id"/>
<one-to-many class="NISG.Framework.PatientModule.Domain.Classes.PatientTelephoneNumber, NISG.Framework.PatientModule.Domain"/>
</bag>
<bag name="EletronicContacts" cascade="all-delete-orphan" inverse="true" lazy="false">
<key column="patient_id"/>
<one-to-many class="NISG.Framework.PatientModule.Domain.Classes.PatientElectronicContact, NISG.Framework.PatientModule.Domain"/>
</bag>
</class>
Below linked mapping class:
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="NISG.Framework.PatientModule.Domain.Classes.PatientElectronicContact, NISG.Framework.PatientModule.Domain" table="tbl_patient_eletronic_contacts" lazy="false">
<id name="Id"
type="System.Guid"
unsaved-value="00000000-0000-0000-0000-000000000000"
column="patient_electronic_contact_id">
<generator class="guid.comb"/>
</id>
<!--<composite-id>
<key-many-to-one name="Patient_Id" class="NISG.Framework.PatientModule.Domain.Classes.Patient, NISG.Framework.PatientModule.Domain" column="patient_id"/>
<key-property name="id" column="patient_electronic_contact_id" />
</composite-id>-->
<property name="Url" column="url" type="StringClob"/>
<property name="Type" column="type" type ="StringClob"/>
<many-to-one name="Patient_Id" class="NISG.Framework.PatientModule.Domain.Classes.Patient, NISG.Framework.PatientModule.Domain" column="patient_id"/>
</class>
</hibernate-mapping>
I have been looking at this for a couple of days now and I really help.
Thanks in advance