Hi ,
I am running a test of my code and am receiving a System.InvalidCharacter exception from the CodeDom.
Below is a portion of the mapping file and the resultant code.
The line from the mapping to take notice of is
<property name="AddressId" column="addressId" type="Guid" />
<many-to-one name="Address" column="addressId" class="Intuit.SBM.Platform.AddressData, Intuit.SBM.Platform" update="false" insert="false" />
which results in
t.AddressId = values[10] == null ? new System.Nullable`1[[System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]() : (System.Nullable`1[[System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]])values[10];
I don't understand where the `1 is coming from.
Has anyone seen this before?
Thanks
Bruce
Hibernate version1.02:
[b]Mapping documents:
<class name="Intuit.SBM.Platform.ContactData" table="Contact" dynamic-update="true" dynamic-insert="true">
<id name="Id" type="Guid" column="contactId" >
<generator class="assigned" />
</id>
<property name="CreatedDateTime" column="createdDateTime" type="DateTime" />
<property name="ModifiedDateTime" column="modifiedDateTime" type="DateTime" />
<property name="AddressId" column="addressId" type="Guid" />
<many-to-one name="Address" column="addressId" class="Intuit.SBM.Platform.AddressData, Intuit.SBM.Platform" update="false" insert="false" />
<property name="TelephoneNumber1" column="telephoneNumber1" type="String" />
<property name="TelephoneNumber2" column="telephoneNumber2" type="String" />
<property name="CellularNumber" column="cellularNumber" type="String" />
<property name="EMail" column="email" type="String" />
<property name="EMailCarbonCopy" column="emailCarbonCopy" type="String" />
<property name="FaxNumber" column="faxNumber" type="String" />
<property name="PagerNumber" column="pagerNumber" type="String" />
<property name="PagerPin" column="pagerPin" type="String" />
<property name="Contact1" column="contact1" type="String" />
<property name="Contact2" column="contact2" type="String" />
<property name="Note" column="note" type="String" />
<property name="ExpiredDate" column="expiredDate" type="DateTime" />
</class>
Code:
using System;
using NHibernate.Property;
namespace NHibernate.Persister {
public class GetSetHelper_Intuit_SBM_Platform_ContactData : IGetSetHelper {
ISetter[] setters;
IGetter[] getters;
public GetSetHelper_Intuit_SBM_Platform_ContactData(ISetter[] setters, IGetter[] getters) {
this.setters = setters;
this.getters = getters;
}
public void SetPropertyValues(object obj, object[] values) {
Intuit.SBM.Platform.ContactData t = (Intuit.SBM.Platform.ContactData)obj;
try
{
t.TelephoneNumber2 = (System.String)values[0];
t.CellularNumber = (System.String)values[1];
t.Note = (System.String)values[2];
t.EMailCarbonCopy = (System.String)values[3];
t.Contact2 = (System.String)values[4];
t.Contact1 = (System.String)values[5];
t.PagerPin = (System.String)values[6];
t.CreatedDateTime = values[7] == null ? new System.DateTime() : (System.DateTime)values[7];
t.PagerNumber = (System.String)values[8];
t.Address = (Intuit.SBM.Platform.AddressData)values[9];
t.AddressId = values[10] == null ? new System.Nullable`1[[System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]() : (System.Nullable`1[[System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]])values[10];
t.ModifiedDateTime = values[11] == null ? new System.DateTime() : (System.DateTime)values[11];
t.TelephoneNumber1 = (System.String)values[12];
t.ExpiredDate = values[13] == null ? new System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]() : (System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]])values[13];
t.FaxNumber = (System.String)values[14];
t.EMail = (System.String)values[15];
}
catch( InvalidCastException ice )
{
throw new MappingException(
\"Invalid mapping information specified for type \" + obj.GetType() + \", check your mapping file for property type mismatches\",
ice);
}
}
public object[] GetPropertyValues(object obj) {
Intuit.SBM.Platform.ContactData t = (Intuit.SBM.Platform.ContactData)obj;
object[] ret = new object[16];
ret[0] = t.TelephoneNumber2;
ret[1] = t.CellularNumber;
ret[2] = t.Note;
ret[3] = t.EMailCarbonCopy;
ret[4] = t.Contact2;
ret[5] = t.Contact1;
ret[6] = t.PagerPin;
ret[7] = t.CreatedDateTime;
ret[8] = t.PagerNumber;
ret[9] = t.Address;
ret[10] = t.AddressId;
ret[11] = t.ModifiedDateTime;
ret[12] = t.TelephoneNumber1;
ret[13] = t.ExpiredDate;
ret[14] = t.FaxNumber;
ret[15] = t.EMail;
return ret;
}
}
}
|