That type of map is known as a ternary relationship so what you're
looking for is AsTernaryAssociation() on HasManyToMany. For example:

HasManyToMany(x => x.forecasts).AsTernaryAssocation();

AsTernaryAssociation has a number of overloads if you need to tweak
types and column names. Of course, your forecasts dictionary is marked
private and I have no idea how this might or might not work with a
private property.

On Thu, Aug 20, 2009 at 10:08 AM, Wayne
Douglas<[email protected]> wrote:
>
> I ended up leaving it as is for now i'm affraid - i'm in the process
> of refactoring 3 huge slns and thought it best to leave the complex
> mappings as is - here's the hbm section for the mapping anyway:
>
> <code>
>
> <map name="Forecasts" access="field.camelcase" cascade="all">
>      <key column="AccountId" />
>      <index-many-to-many column="FiscalPeriodId"
> class="IRM.Model.FiscalPeriod" />
>      <one-to-many class="Forecast" />
> </map>
>
> </code>
>
>
> here's the mode code:
>
> <code>
>
> private IDictionary<FiscalPeriod, Forecast> forecasts = new
> Dictionary<FiscalPeriod, Forecast>();
>
> </code>
>
> :)
>
> when i have the refactoring stable i'll come back to this - one of the
> benefits i was hoping for was to bring in fluentnhibernate.testing -
> lovelly. time's a constraint as ever though
>
> w://
>
> On Thu, Aug 20, 2009 at 2:54 PM, Stuart Childs<[email protected]> wrote:
>>
>> It takes either the column name string or a lambda expression pointing
>> to the index property on your entity. What sort of collection are you
>> trying to map? If we know the signature and desired behavior, we might
>> be able to give a better answer.
>>
>> On Thu, Aug 20, 2009 at 4:05 AM, Wayne
>> Douglas<[email protected]> wrote:
>>>
>>> Hi
>>>
>>> Does anyone have an example of using AsIndexedCollection? cant figure
>>> out what i'm supposed to pass to it?
>>>
>>>
>>> --
>>> Cheers,
>>>
>>> w://
>>>
>>> >
>>>
>>
>> >
>>
>
>
>
> --
> Cheers,
>
> w://
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" 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/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to