That should work, but my mapping requires the specific key column. I think I was just not sure how the new syntax work.
Anyway, I found the issue by comparing the hbm files. It turns out that I have to also specify OneToMany() into the mapping as well otherwise it is trying to make it ManyToMany. Old Mapping ========= HasMany<Identification>(x => x.Ids) .AsMap<string>(x => x.Type) .Cascade.AllDeleteOrphan(); New Mapping ========== HasMany(x => x.Ids) .DictionaryKey<string>("Type") .OneToMany() .Cascade.AllDeleteOrphan(); Thanks! On Wed, Sep 8, 2010 at 5:14 PM, James Gregory <jagregory....@gmail.com> wrote: > HasMany(x => x.Ids) should do the trick. Does it not? > > On 8 Sep 2010, at 21:30, kimsk112 <karl...@gmail.com> wrote: > >> Firstly, I just want to thank anyone who contributed to the project. I >> really appreciate your effort. >> >> I just downloaded the build #692, and I am trying to update my code to >> be compliant with new Dictionary Mapping. >> >> Here are my classes: >> >> public class Person >> { >> ... >> public virtual IDictionary<string, Identification> Ids {get;set;} >> } >> >> public class Identification >> { >> public virtual string Type { get; set; } >> public virtual string Value { get; set; } >> } >> >> >> My current mapping is below: >> >> public class PersonMap : SubclassMap<Person> >> { >> public PersonMap() >> { >> ... >> HasMany<Identification>(x => x.Ids) >> .AsMap<string>(x => x.Type) >> .Cascade.AllDeleteOrphan() >> .NotFound.Ignore(); >> ... >> } >> } >> >> public class IdentificationMap : SubclassMap<Identification> >> { >> public IdentificationMap() >> { >> Table("IDENTIFICATION"); >> Map(x => x.Value) >> .Not.Nullable(); >> Map(x => x.Type); >> } >> } >> >> >> How should I map them with the new Dictionary Mapping? >> >> Thanks, >> Karlkim >> >> >> -- >> 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. >> > > -- > 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. > > -- Karlkim SK Go Vandy! -- 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.