What are the differences between HasOne()
and References()
in nhibernate?
C# – What are the differences between HasOne and References in nhibernate
cfluent-nhibernatenetnhibernate
Related Topic
- C# – the difference between const and readonly in C#
- .net – What are differences between AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion
- C# – How to enumerate an enum
- C# – What are the correct version numbers for C#
- .net – In WPF, what are the differences between the x:Name and Name attributes
- .net – Difference between decimal, float and double in .NET
- C# – a NullReferenceException, and how to fix it
- R – Make individual checkboxes on WPF datagrid not visible
Best Answer
HasOne
creates a one-to-one mapping between tables for you.References
creates a typical relational many-to-one relationship.More defined:
Note: where I say table you can replace that safely with class or entity as you wish, when using FluentNH it's easy to use them interchangeably.
This is more precisely explained in this fluentnhibernate wiki article.