Hi,

 

the problem has been that I've used CheckProperty instead of CheckList
inside the persistence spec.

 

And I had to change the mapping from HasMany to HasManyToMany<Model>.

 

But now I get an extra Table SubModelsToSubModels.

 

Is it possible to solve this using only the Models table?

 

Alex

 

From: fluent-nhibernate@googlegroups.com
[mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Paul Batum
Sent: Sonntag, 18. Juli 2010 08:13
To: fluent-nhibernate
Subject: Re: [fluent-nhib] List of same Type as Property / One To Many

 

Is your mapping actually working ok? It looks fine to me - I suspect the
issue is with the persistence spec rather than the mapping itself but it
would be useful if you could confirm this.

On Sun, Jul 18, 2010 at 5:19 AM, Alexander Zeitler <a...@alexonasp.net>
wrote:

Hi,

 

I've the following class (symplified):

 

public class Model {

                public virtual Guid Id {get;set;}

                public virtual IList<IModel> Models {get;set;} 

}

 

 

I tried to map this way:

HasMany< Model >(model => model.
Models).KeyColumn("ParentModelId").AsBag().Cascade.All();

 

When running PersistenceSpecification. VerifyTheMappings(), I get the
following error:

 

For property 'Models' expected
'System.Collections.Generic.List`1[MyApp.Model]' of type
'System.Collections.Generic.List`1[[MyApp.Model, MyApp.Contracts,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' but got
'MyApp.Domain.Model, MyApp.Domain.Model of type
'System.Collections.Generic.IList`1[[MyApp.Model, MyApp.Contracts,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'

 

So there seems to be an error in my mapping because the child's got not
returned as lists but as single objects instead.

 

What am I doing wrong?

 

Alex

-- 
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to
fluent-nhibernate+unsubscr...@googlegroups.com
<mailto:fluent-nhibernate%2bunsubscr...@googlegroups.com> .
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en.

 

-- 
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" group.
To post to this group, send email to
<mailto:fluent-nhibernate@googlegroups.com>
fluent-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to
<mailto:fluent-nhibernate+unsubscr...@googlegroups.com>
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at
<http://groups.google.com/group/fluent-nhibernate?hl=en>
http://groups.google.com/group/fluent-nhibernate?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.

Reply via email to