Hey all,
I'm attempting to map a simple class, Volunteer, containing a
component, Address, using a stored procedure (legacy db) to load. I
get the following error, however, when trying to run my tests:
NHibernate.ADOException: could not execute query
[ exec GetVolunteer @i...@p0 ]
Name:ID - Value:202
[SQL: exec GetVolunteer @i...@p0] ---> System.IndexOutOfRangeException:
Address6_11_1_
at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String
fieldName)
The error is specific to the Address component, as my tests run fine
when I comment out all address-related mapping, and various other non-
component properties within the class (age, status, etc.) map without
any problems.
The relevant portions of the mapping file are below:
<class name="Volunteer">
<id name="ID">
<generator class="native" />
</id>
.
.
.
<component name="Address" class="Address">
<property name="AddressLine1" />
<property name="AddressLine2" />
<property name="City" />
<property name="State" />
<property name="PostalCode" />
</component>
<loader query-ref="GetVolunteer" />
</class>
<sql-query name="GetVolunteer">
<return class="Volunteer">
<return-property name="ID" column="ID" />
.
.
.
<return-property name="AddressLine1"
column="AddressLine1" />
<return-property name="AddressLine2"
column="AddressLine2" />
<return-property name="City" column="City" />
<return-property name="State" column="State" />
<return-property name="PostalCode" column="PostalCode"
/>
</return>
exec GetVolunteer @ID=:ID
</sql-query>
I've tried tinkering with it quite a bit, and have searched this list
and the web to no avail. Any help is greatly appreciated. Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---