You are the man..., works like a charm. Btw, there is not new database
(hell I tell you)

On Mar 10, 1:00 pm, epitka <[email protected]> wrote:
> This is already using an "updatable" view (view with a trigger), there
> is much more "mess" behind the scenes, but that gives me an idea to
> map same column in a view with different name ...., let me see if it
> works.
>
> On Mar 10, 12:48 pm, Humberto Marchezi <[email protected]> wrote:
>
>
>
> > Hi epitka,
>
> > One complementary way to minimize this problem is to create views in the new
> > database.
> > These views can map the old tables at the same time that it makes use of
> > data model formatting from the new database and thus NHibernate don´t need
> > to do too much "gymnastics".
>
> > ---------- Forwarded message ----------
> > From: epitka <[email protected]>
> > Date: Wed, Mar 10, 2010 at 2:57 PM
> > Subject: [nhusers] Mapping same column as property and relationship ("Index
>
> > out of range error")
> > To: nhusers <[email protected]>
>
> > I am working on new system using legacy db and need to do some
> > "gymnastics" to make new system work using the same database (yeah I
> > know) as the old one, and they should both be compatible for some
> > time. So to do this, I need to map a column as attribute and as a
> > relationship and I am running into NH error "Index out of range" Here
> > is how the mapping looks like
>
> >  References(x => x.BaseProductTemplate, "ProductCodeTxt");
> >  Map(x => x.DescriptionCode, "ProductCodeTxt")
> >                .CustomType(typeof(TrimmedStringUserType));
>
> > and error is
>
> > System.IndexOutOfRangeException: Invalid index 9 for this
> > SqlParameterCollection with Count=9.
>
> > If I comment out "References" it works, but then I cannot navigate the
> > relationship. How do I do this?
>
> > --
> > 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]<nhusers%[email protected] 
> > >
> > .
> > For more options, visit this group 
> > athttp://groups.google.com/group/nhusers?hl=en.
>
> > --
> > Humberto C Marchezi
> > ---------------------------------------------------------
> > Master in Electrical Engineering - Automation
> > Software Consultant and Developer
> > at the Town Hall of Vitória

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