Hi, I came across an issue when mapping an HasMany-collection.

with the following code:

      private IList<CartDiscount> applicableDiscounts;
       
      [HasMany(
            typeof( CartDiscount ),
            Access = PropertyAccess.FieldCamelcase,
            Cascade = ManyRelationCascadeEnum.AllDeleteOrphan,
            RelationType = RelationType.List
        )]
        public IEnumerable<CartDiscount> ApplicableDiscounts { .... }


My app fails to start with the following exception:

[IndexOutOfRangeException: Index was outside the bounds of the array.]
   NHibernate.Mapping.Column.set_Name(String value) in 
c:\CSharp\NH\nhibernate\src\NHibernate\Mapping\Column.cs:85


Looking at the sourcecode, I see this:


public string Name
{
    get { return name; }
    set
    {
85:    if (value[0] == '`')



and when debugging, I see that value is actually an empty string.
however, if I change the RelationType on the collection to "Set", the
problem goes away. Why is that? Is it trying to add some secret column
which doesn't get a name correctly or something?

Maybe this should go to NH-list instead, but it's partly an
ActiveRecord-issue.

What is the default RelationType for a generic IList<>? Bag or List?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to