I recently had the same issue so maybe I can help...
Does the generated mapping include a inverse="true" on the list you're
having this issue with?
If so, try to make this end (and not the many-to-one) manage the
association by setting inverse="false"
and on the other end insert="false" and update="false".
Hope this helps, Peter.
On 19 Mag, 16:12, Stuart Childs <
chil...@gmail.com> wrote:
> This is an NHibernate issue and I'm not 100% sure, but the error
> message implies to me that you have a null value in your index column.
> NHibernate requires your index column to be integer values starting at
> zero.
>
> However, export the mappings FNH is generating to be sure it's not an
> issue with the HBM generation.
>
> Le May 19, 2009 à 8:38 AM, HMS <
jvander...@gmail.com> a écrit :
>
>
>
>
>
> > Hello,
>
> > I'm running into the following problems while mapping a List of
> > objects using List semantics, I can't use a bag because the order is
> > important.
>
> > However when testing I get the following exception:
>
> > NHibernate.HibernateException: null index column for collection:
> > SubPhases.
>
> > The mapping looks like this:
>
> > HasMany(p => p.SubPhases)
> > .Inverse()
> > .KeyColumnNames.Add("ParentPhase")
> > .AsList(index => index.WithColumn("idx"))
> > .Cascade.AllDeleteOrphan();
>
> > I've also tried
>
> > .AsList() and AsList(index => index.WithColumn("idx").WithType<int>())
>
> > both without success.
>
> > Am I missing something obvious ?
>
> > Thanks :)
>
> > - HMS- Nascondi testo citato
>
> - Mostra testo citato -