-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Object reference not set to an instance of an object
PostPosted: Tue Feb 09, 2010 11:43 am 
Newbie

Joined: Tue Feb 09, 2010 11:32 am
Posts: 5
Hi,
I am new to NHibernate and am having some major difficulties.
I am using a WCF hosting application developed by another developer in my organisation.
The problem I am having is when I try to send my populated object across the wire I get "Object reference not set to an instance of an object".
A little about my class structure:
I have a class design for patient data.
It is made up of many Collection properties e.g. IList<PatientAddress> patientAddresses, IList<PatientIdentifier> patientIdentifiers and so on. If I populate one of the ILists it works fine, but when I attempt to populate more than one I get the above error.

My Configuration File looks like this

<?xml version="1.0" encoding="utf-8" ?>
<!-- Maps to the Patient Domain Object -->
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="NISG.Framework.PatientModule.Domain.Classes.Patient, NISG.Framework.PatientModule.Domain" table="tbl_patients" lazy="false">
<id name="Id"
type="System.Guid"
unsaved-value="00000000-0000-0000-0000-000000000000"
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">
<key column="patient_id"/>
<one-to-many class="NISG.Framework.PatientModule.Domain.Classes.PatientName, NISG.Framework.PatientModule.Domain"/>
</bag>

<bag name="Addresses" cascade="all">
<key column="patient_id"/>
<one-to-many class="NISG.Framework.PatientModule.Domain.Classes.PatientAddress, NISG.Framework.PatientModule.Domain"/>
</bag>
<bag name="PatientIdentifiers" cascade="all">
<key column="patient_id"/>
<one-to-many class="NISG.Framework.PatientModule.Domain.Classes.PatientIdentifier, NISG.Framework.PatientModule.Domain"/>
</bag>
<bag name="AssociatedPeople" cascade="all">
<key column="patient_id"/>
<one-to-many class="NISG.Framework.PatientModule.Domain.Classes.AssociatedPerson, NISG.Framework.PatientModule.Domain"/>
</bag>
<bag name="TelephoneNumbers" cascade="all">
<key column="patient_id"/>
<one-to-many class="NISG.Framework.PatientModule.Domain.Classes.PatientTelephoneNumber, NISG.Framework.PatientModule.Domain"/>
</bag>
<bag name="EletronicContacts" cascade="all">
<key column="patient_id"/>
<one-to-many class="NISG.Framework.PatientModule.Domain.Classes.PatientElectronicContact, NISG.Framework.PatientModule.Domain"/>
</bag>
</class>
</hibernate-mapping>
Please Help...
my head is sore from the repeated battering on the wall...
Cheers,
Mark


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.