I'm working with a legacy database put together by some very strange people. I'm writing an NHibernate DAL over the top of it but running into some odd mapping scenarios.
In one example, I have a table with a number of fields including LE_RECNUM
(integer primary key) and LE_CODE
(string).
However, all relationships throughout the database join onto LE_CODE
, not LE_RECNUM
, for some unfathomable reason.
I need to specify that LE_RECNUM
is the Id in my mapping file, because I need the primary key to be generated when I insert records. However, I want all associations to use LE_CODE
instead of LE_RECNUM
.
Can anyone suggest how I might do this?
References(x => x.SomeProperty).Column("LE_CODE").PropertyRef(x => x.SomePropertyInParent);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With