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.  [ 2 posts ] 
Author Message
 Post subject: Problem with code generated for Reflection Optimizer
PostPosted: Mon Mar 12, 2007 9:13 pm 
Beginner
Beginner

Joined: Mon Sep 26, 2005 5:57 pm
Posts: 39
I was debugging through the Nhibernate code, and I get a first chance exception in the GetSetHelperFactory.Build method: "Unexpected character '`'"

It turns out the code generated in GenerateCode method has an unexpected character in statemennts containing System.Nullables.

The generated code is:

using System;
using NHibernate.Property;
namespace NHibernate.Persister {
public class GetSetHelper_CID_IPath_NewBusinessLayer_claimuser : IGetSetHelper {
ISetter[] setters;
IGetter[] getters;
public GetSetHelper_CID_IPath_NewBusinessLayer_claimuser(ISetter[] setters, IGetter[] getters) {
this.setters = setters;
this.getters = getters;
}
public void SetPropertyValues(object obj, object[] values) {
CID.IPath.NewBusinessLayer.claimuser t = (CID.IPath.NewBusinessLayer.claimuser)obj;
try
{
t.ext = (System.String)values[0];
t.webaccesscode = (System.String)values[1];
t.fax = (System.String)values[2];
t.role = (CID.IPath.NewBusinessLayer.claimuserrole)values[3];
t.Domain = (CID.IPath.NewBusinessLayer.MasterDomain)values[4];
t.webaccesslevel = (System.String)values[5];
t.claimworksessions = (System.Collections.IList)values[6];
t.orglocations = (System.Collections.IList)values[7];
t.rsatokenrequired = (System.String)values[8];
t.email = (System.String)values[9];
t.projects = (System.Collections.IList)values[10];
t.physiciangroup = (CID.IPath.NewBusinessLayer.physiciangroup)values[11];
t.status = (CID.IPath.NewBusinessLayer.claimuserstatus)values[12];
t.activities_pertaining_to_me = (System.Collections.IList)values[13];
t.rsausername = (System.String)values[14];
t.inboxdocuments = (System.Collections.IList)values[15];
t.recusals = (System.Collections.IList)values[16];
t.mi = (System.String)values[17];
t.title = (System.String)values[18];
t.address = (CID.IPath.NewBusinessLayer.address)values[19];
t.rsaserialnumber = (System.String)values[20];
t.lastname = (System.String)values[21];
t.showcompletedactivities = (System.String)values[22];
t.require_certified_mail = (System.String)values[23];
t.activities_for_which_i_am_responsible = (System.Collections.IList)values[24];
t.faxinstructions = (System.String)values[25];
t.password = (System.String)values[26];
t.communicationpreferences = (System.Collections.IList
)values[27];
t.firstname = (System.String)values[28];
t.administrator = values[29] == null ? new System.Boolean() : (System.Boolean)values[29];
t.lastloggedin = values[30] == 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[30];
t.telephone = (System.String)values[31];
t.signaturefilename = (System.String)values[32];
t.employed_by_cid = values[33] == null ? new System.Boolean() : (System.Boolean)values[33];
t.organizations = (System.Collections.IList)values[34];
}
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) {
CID.IPath.NewBusinessLayer.claimuser t = (CID
.IPath.NewBusinessLayer.claimuser)obj;
object[] ret = new object[35];
ret[0] = t.ext;
ret[1] = t.webaccesscode;
ret[2] = t.fax;
ret[3] = t.role;
ret[4] = t.Domain;
ret[5] = t.webaccesslevel;
ret[6] = t.claimworksessions;
ret[7] = t.orglocations;
ret[8] = t.rsatokenrequired;
ret[9] = t.email;
ret[10] = t.projects;
ret[11] = t.physiciangroup;
ret[12] = t.status;
ret[13] = t.activities_pertaining_to_me;
ret[14] = t.rsausername;
ret[15] = t.inboxdocuments;
ret[16] = t.recusals;
ret[17] = t.mi;
ret[18] = t.title;
ret[19] = t.address;
ret[20] = t.rsaserialnumber;
ret[21] = t.lastname;
ret[22] = t.showcompletedactivities;
ret[23] = t.require_certified_mail;
ret[24] = t.activities_for_which_i_am_responsible;
ret[25] = t.faxinstructions;
ret[26] = t.password;
ret[27] = t.communicationpreferences;
ret[28] = t.firstname;
ret[29] = t.administrator;
ret[30] = t.lastloggedin;
ret[31] = t.telephone;
ret[32] = t.signaturefile
name;
ret[33] = t.employed_by_cid;
ret[34] = t.organizations;
return ret;
}
}
}


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 12, 2007 9:30 pm 
Regular
Regular

Joined: Tue Aug 08, 2006 4:28 am
Posts: 96
Location: Hong Kong
What version of NHibernate are you using? NH 1.0.x is based on .net 1.1 and does not support Generics. Try NH 1.2.


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

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.