I’m afraid I may be asking a stupid question here, but my google-fu seems to be suffering. Most RDBMS’s support creating a foreign key referencing a unique key in another table that is not the primary key, but I can’t seem to find a “how-to” on this for NHibernate. I assume because everyone assumes it’s stupid-easy.
Is this supported? Are there any caveats? What would an XML mapping look like for that?
If I understand well your question,
property-refis what you’re looking forFrom Nhibernate docs (5.1.12. Many-to-one)
I personally don’t know any caveats but Ayende Rahien, an active member of NHibernate development team, strongly suggest to avoid this if possible. He doesn’t say why, probably just because is ugly 🙂