This looks like NH bug.Post this to nh users along with the hbm.

On Fri, Apr 24, 2009 at 3:20 PM, bdaniel7 <[email protected]> wrote:

>
> Hello,
>
> I have this situation:
> class Order
> {
>                [HasMany( Inverse=true,
> Cascade=ManyRelationCascadeEnum.SaveUpdate)]
>                public virtual IList< OrderItem > Items
>                {
>                        get { return items; }
>                        set { items = value; }
>                }
> }
>
> class OrderItem
> {
>                [BelongsTo( "[Order]" )]
>                public virtual Order Order
>                {
>                        get { return order; }
>                        set { order = value; }
>                }
>
>                [Any( typeof ( int ), MetaType = typeof ( ProductType ),
> TypeColumn
> = "ProductType", IdColumn = "ProductID" )]
>                [Any.MetaValueAttribute( "0", typeof ( Color ) )]
>                [Any.MetaValueAttribute( "1", typeof ( VerandaSize ) )]
>                [Any.MetaValueAttribute( "2", typeof ( RoofPlate ) )]
>                [Any.MetaValueAttribute( "3", typeof ( Pillar ) )]
>                [Any.MetaValueAttribute( "4", typeof ( SideFrame ) )]
>                [Any.MetaValueAttribute( "5", typeof ( WindScreen ) )]
>                public virtual IPricedModel Product
>                {
>                        get { return product; }
>                        set { product = value; }
>                }
>
> }
>
> Because there are multiple products that share some properties, I
> picked this approach.
> Now, when I try to save an Order, with several OrderItems, I receive
> this errror:
> "Invalid index 5 for this SqlParameterCollection with Count=5"
> The log makes me think that this occurs when trying to save the
> OrderItem.
> In debugger, all OrderItems that I'm saving have all the data
> required.
>
> Can someone tell me to why is this happening?
> Thanks,
> Dan
> >
>

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