Unless someone fixed it when I wasn't looking, AsTernaryAssociation
can only generate a mapping that "looks correct" in XML, but doesn't
actually work (i.e. NH wants a Dictionary object, AsTernaryAssociation
won't take one). I started on some HasMap functionality to make
mapping "Maps" more fluent a couple months ago
(http://github.com/childss/fluent-nhibernate/commit/67d4a5064cb87ae610fff71da8308db4c8300cb1)
but put it to the side while the core was rewritten for the model.  I
guess now that that's fairly well stabilized I can take another look
at that and get a real implementation of AsTernaryAssociation. Maybe
we can resume the discussion of HasMap on the dev list if you feel the
syntax/concept needs reworking.

On Tue, Jul 28, 2009 at 8:54 AM, James Gregory<[email protected]> wrote:
> There's an AsTernaryAssociation method on HasMany, is that not of use?
>
> On Tue, Jul 28, 2009 at 2:43 PM, Paul Batum <[email protected]> wrote:
>>
>> I'm afraid there isn't a way to mix xml and fluent mappings at the level
>> you are hoping for. You will need to map that class using xml or start
>> working on a patch for ternary support :)
>>
>> On Sat, Jul 25, 2009 at 6:22 PM, Fost andy <[email protected]> wrote:
>>>
>>> Howdy folks,
>>>
>>> I'm wondering if there is a way to inline raw xml code into a fluent
>>> mapping? I know fluent has hybrid mapping capabilities but as I
>>> understand it this is only on the per-class granularity, and I guess I
>>> am looking for per property granularity.
>>>
>>> I have a class with a number of fields, all of which but one can be
>>> mapped nicely by fluent nhibernate. The exception is a Dictionary that
>>> represents a ternary association (I'm assuming it can't based on posts
>>> like this
>>> http://stackoverflow.com/questions/970180/fluent-nhibernate-dictionary-mapping-with-class-key
>>> - the other reason for this post is to confirm this is the case).
>>>
>>> Thanks to this post (
>>> http://noahblu.wordpress.com/2009/01/14/nhibernate-generic-dictionary-mapping/
>>> ) I have the hbm.xml to correspond to this mapping, but was just
>>> wondering if there was a way to just put this segment into my existing
>>> fluent mapping, instead of having to manually create the entire
>>> hbm.xml mapping manually?
>>>
>>> Basically, I want to have it combine code like:
>>>
>>> <map name=”DesertRatings” table=”PeopleDesertRatings”>
>>> <key column=”PersonId” />
>>> <index-many-to-many class=”Desert” column=”DesertId” />
>>> <element column=”Rating” type=”MyNamespace.Rating” not-null=”true” />
>>> </map>
>>>
>>> with a fluent mapping to produce the appropriate hbm.xml (I wouldn't
>>> expect it to undergo the same verification process).
>>>
>>> As I write this I realise that I could do this by manually exporting
>>> the files and then editing them to insert the code and reloading, but
>>> perhaps there is an easier way?
>>>
>>>
>>
>>
>>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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