Is there a way to map property with database column with custom column, that IS NOT a FK, just a candidate key ( it is unique for table )?
If not, what is my options here? (need to restrict select
results with joined table restrictions)
Is there a way to map property with database column with custom column, that IS NOT a FK, just a candidate key ( it is unique for table )?
If not, what is my options here? (need to restrict select
results with joined table restrictions)
NHibernate supports feature called
property-ref
. It is documented here: 5.1.10. many-to-one. Some extract:So, if the child table contains for example
Guid
, which is the same as in the target parent table... this could solve the issue. Example mapping:Using the fluent syntax, it could look like this:
Anyhow, this is not ideal and should be used mostly for solving legacy stuff.