Add property-ref and not-found attributes in mapping by code

Description

I cannot find the way to indicate what was done with the "property-
ref" and "not-found" attributes in a ManyToOne() relationship.

Eg:
<many-to-one
name="Client"
column="cCode"
property-ref="ClientCode" // the non-id column to use in the join
not-found="ignore"
/>

ManyToOne(x => x.CardHolder, map => {
map.Column("sClient");
map.PropertyRef(x => x.ClientCode); // No
PropertyRef() method available?
map.NotFound(NotFoundOptions.Ignore); // No NotFound()
method available?
});

Unfortunately I'm dealing with legacy databases and this issues come up to often.

Environment

None

Activity

Show:
Fatih Ender
November 17, 2011, 10:30 AM

i just need the property-ref attribute to use with
legacy database

Rui Lima
December 10, 2011, 4:53 PM

Hello guys, I was faving this problem also.
Come into a quick fix, please see attachement.
I know it's not the most correct way, but I needed this fixed ASAP. I'm sharing with you if you consider it good for your projects use it.

Oliver Joest
January 5, 2012, 3:54 PM

The PropertyRef seems missing also from Join with mapping ByCode, would be very helpful while dealing with Legacy DBs.

Pedro Alvarado
January 23, 2012, 12:31 AM

I've got a pull request on GitHub that addresses this issue.
https://github.com/nhibernate/nhibernate-core/pull/62

Oskar Berggren
May 30, 2012, 6:32 PM

Closing issues fixed in 3.3.1.CR1.

Fixed

Assignee

Unassigned

Reporter

Nicolás Sabena

Components

Fix versions

Affects versions

Priority

Major
Configure