Yes, it would be a propertybag.The example that I mentioned is in
fluent nhibernate,but it is also fine for me to know how to fix it in
nhibernate xml mapping.The problem with component or dynamic component
is that I need to specify the properties which I do not know and I
will have the information at run time.That is why I need to map them
dynamically.
I also posted the same question in fluent nhibernate user group and
hope to get some answers in any of the groups.
Thanks.
On Jun 15, 1:40 pm, sima ganji <
simaga...@gmail.com> wrote:
> I explained the situation in my previous post.Any thought how to do this
> mapping?
>
>
>
> On Mon, Jun 15, 2009 at 12:41 PM, sima ganji <
simaga...@gmail.com> wrote:
> > Something like this:
> > In Entity.cs I have this
> > public virtual IDictionary AdditionalFields { get; set; }
> > public virtual Info AdditionalFieldsInfo{get; set;}
>
> > In EntityMap.cs I have this
>
> > References(x => x.AdditionalFieldsInfo);
>
> > and I should have something like this:
>
> > DynamicComponent(x => x.AdditionalFields , m =>
>
> > {
>
> > m.Map(?I dont have the number of columns to be mapped and column
> > names.These information needs to come from AdditionalFieldsInfo);
>
> > });
>
> > Regards,
>
> > On Mon, Jun 15, 2009 at 12:10 PM, Fabio Maulo <
fabioma...@gmail.com>wrote:
>
> >> You mean that you have a ProperyBag ? You can persist a PropertyBag using
> >> Map or Dynamic-Map how present the PropertyBag outside persistence stuff is
> >> another matter.
>
> >> 2009/6/15 sima ganji <
simaga...@gmail.com>
>
> >> Thanks for your reply Fabio,but I am still not very sure how to
> >>> implement this.Could you please give me more explanation?
> >>> My main entity and it's mapping is there, but I have some more fields
> >>> which I need to map them dynamically.
>
> >>> Regards,
>
> >>>> 2009/6/14 Silvia <
simaga...@gmail.com>
>
> >>>>> Here is the situation:
> >>>>> I am using fluent nhibernate with a legacy database. I need to map
> >>>>> some additional columns to a dictionary(?) property in my entity
> >>>>> dynamically, because I do not know the number of columns and column
> >>>>> names and other specifications at compile time and I dynamically need
> >>>>> to work with those columns(insert,update...).There is another object
> >>>>> which has those information and has a relationship with my main entity
> >>>>> based on the value of two other columns.Is this possible in
> >>>>> nhibernate?
> >>>>> I tried to use DynamicComponent but the problem is I don't know what
> >>>>> would be the properties in my component.
> >>>>> I appreciate if someone could help.
> >>>>> Thanks
>
> >>>>> (similar problem here:
>
> >>>>>
http://stackoverflow.com/questions/672840/nhibernate-map-unknown-amou...
> >>>>> )
>
> >>>> --
> >>>> Fabio Maulo
>
> >> --
> >> Fabio Maulo- Hide quoted text -
>
> - Show quoted text -