I am working on a small db which tracks medical appointments and
results. The relationship between appointments and results is one-to-
one.
TBL_APPOUNTMENT
APPT_ID (PK)
APPT_DATE
LATEST_RESULT_ID
TBL_RESULT
RESULT_ID (PK)
RESULT_STATUS
Here is my mapping for TBL_APPOINTMENT
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="Medics"
namespace="Medics.tests">
<!-- more mapping info here -->
<class name="TBL_APPOINTMENT">
<id name="APPT_ID">
<generator class="native"/>
</id>
<property name="APPT_ID" />
<property name="APPT_DATE" />
<many-to-one name="LATEST_RESULT_ID"
class="Test_Rslt" cascade="all" unique="true"/>
</class>
</hibernate-mapping>
Here is my mapping for TBL_RESULT
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="Medics"
namespace="Medics.tests">
<!-- more mapping info here -->
<class name="Test_Rslt">
<id name="RESULT_ID" type="long">
<generator class="native"/>
</id>
<property name="RESULT_ID" />
<property name="RESULT_STATUS" />
</class>
</hibernate-mapping>
When I try to retrieve an appointment by APPT_ID, I am getting this
error:
NHibernate.PropertyAccessException : Invalid Cast (check your mapping
for property type mismatches); setter of Medics.tests.TBL_APPOINTMENT
----> System.InvalidCastException : Specified cast is not valid.
Can you please point me to what it is I am doing wrong?
Thanks,
Kris
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.