Hi all,

With NH 2.1.2 I actually get a "NHibernate.PropertyAccessException: Invalid Cast (check your mapping for property type mismatches); setter of Numenalia.Models.ApplicationPreferences" when with NH 2.0.1 this works right.

Here the class:

   public class ApplicationPreferences
{ public ApplicationPreferences() { }

       private long id;
       public long Id {
           get {return id;}
           set {id = value;}
       }
private long version;
       public long Version {
           get {return this.version;}
       }
private string applicationCompany = "Company";
       public string ApplicationCompany {
           get {return applicationCompany;}
       }
private string applicationName;
       public string ApplicationName {
           get {return applicationName;}
           set {applicationName = value;}
} private IDictionary<string, string> parameters = new Dictionary<string, string>(); public IDictionary<string, string> Parameters {
           get {return parameters;}
} }
Here the mapping:

<?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Numenalia" assembly="Numenalia" default-access="field.camelcase"> <class name="ApplicationPreferences" lazy="false"> <id name="Id" unsaved-value="0" access="property">
           <generator class="native"/>
       </id>
       <version name="Version" type="Int64" unsaved-value="undefined"/>
       <property name="ApplicationName" unique="true" />
<map name="Parameters" table="ApplicationPreferencesParameters" lazy="false" >
           <key column="ApplicationPreferencesId"/>
           <index column="ParametersName" type="string"/>
           <element column="ParametersValue" type="string"/>
       </map>
   </class>
</hibernate-mapping>

I've googled for the entire day with no result.

Any idea?

Thanks.

PS -> This wrong behaviour ocurrs me with any class which contains a collection (IList-bag, ISet-set, IDictionary-map...)

Jose Salvador.

--
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.

Reply via email to