Decent .AsTernaryAssociation() documentation

311 views
Skip to first unread message

Francois Botha

unread,
Apr 3, 2012, 4:50:34 AM4/3/12
to fluent-n...@googlegroups.com
Hi all,

I search this list and StackOverflow and nowhere could I get a good, solid explanation of exactly how .AsTernaryAssociation() works. Lots of posts that I did find have conflicting statements. My guess is that the implementation of ternary associations evolved over time.

I'd appreciate it if someone can post a simple example and explanation of a ternary association (please pre-test your code), and a bonus would be to explain the finer tweaks that are possible. In return, I will consolidate all your feedback and compile a page for the Fluent NHibernate Wiki on this subject.

Some questions I have around .AsTernaryAssociation() :
  • Is .AsMap() required or is it ignored? 
  • If it's used, what does .AsMap(null) imply (found that in some posts)?
  • How does HasMany(x => x.stuff).AsTernaryAssociation() vs HasManyToMany(x => x.stuff).AsTernaryAssociation()  work? What's the difference?
  • For a many-to-many ternary association, is the HasManyToMany statement required from all sides (i.e. in all classes)?
  • It seems the default many-to-many table name is KeyValuePair`2ToMyClassName. I can override it with .Table() but is that by design or did I do something wrong?
Or feel free to add anything else.

thanks,
Francois

Francois Botha

unread,
Apr 3, 2012, 4:58:26 AM4/3/12
to fluent-n...@googlegroups.com
I am on:
FluentNHibernate               1.3.0.717 
NHibernate                     3.2.0.4000 

Francois Botha

unread,
Apr 19, 2012, 8:19:57 AM4/19/12
to fluent-n...@googlegroups.com
On Tuesday, 3 April 2012 10:50:34 UTC+2, Francois Botha wrote:
Hi all,

I search this list and StackOverflow and nowhere could I get a good, solid explanation of exactly how .AsTernaryAssociation() works. Lots of posts that I did find have conflicting statements. My guess is that the implementation of ternary associations evolved over time.

I'd appreciate it if someone can post a simple example and explanation of a ternary association (please pre-test your code), and a bonus would be to explain the finer tweaks that are possible. In return, I will consolidate all your feedback and compile a page for the Fluent NHibernate Wiki on this subject.

Anybody? 

Brandon Perry

unread,
Apr 19, 2012, 4:03:29 PM4/19/12
to fluent-n...@googlegroups.com
Best documentation is the code.

> --
> You received this message because you are subscribed to the Google Groups
> "Fluent NHibernate" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/fluent-nhibernate/-/ULHCmdvwwJgJ.
>
> To post to this group, send email to fluent-n...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibern...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/fluent-nhibernate?hl=en.

--
http://volatile-minds.blogspot.com -- blog
http://www.volatileminds.net -- website

Francois Botha

unread,
Apr 19, 2012, 4:38:51 PM4/19/12
to fluent-n...@googlegroups.com


> Best documentation is the code.
>

Already tried that and failed. But you're welcome to prove me wrong.

James Gregory

unread,
Apr 26, 2012, 8:44:08 AM4/26/12
to fluent-n...@googlegroups.com
I'm afraid the code is terrible, and this functionality is completely unknown to me. It's something that needs to be killed/rebuilt, but I haven't had any volunteers (and don't use the functionality myself).
Reply all
Reply to author
Forward
0 new messages