Hi,

I asked a similar question in the user group, but I am also posting it here
hoping that someone could point me in the right direction.

I'm having some problems regarding the new field intercepting proxy, I have
been trying to solve it myself but I'm not sure how. I have this mapping:

<class name="Person">
<id name="Id"/>
<property name="Name"></property>
</class>

<class name="Employee">
<id name="Id"/>
<property name="Name"></property>

<one-to-one name="Person" constrained="true" lazy="proxy"/>
</class>

If I call session.Get<Employee>(id) I get a field intercepting proxy. Should
it not return a regular object instead?

Looking at the code, especially in PocoEntityTuplizer.cs and
EntityMetamodel.cs, it seems to not take into account
the Property.Value.IsConstrained property for the one-to-one relation. But,
as Fabio has mentioned, should not a field intercepting proxy be generated
only if lazy="no-proxy"?

Any thoughts?

The main reason that I don't want it to return a field intercepting proxy is
because of these jira tickets which prohibits me to use the latest trunk in
production:

http://nhjira.koah.net/browse/NH-2092
http://nhjira.koah.net/browse/NH-2093
http://nhjira.koah.net/browse/NH-2094

Regards,

/Johannes Gustafsson

PS. This is probably unrelated, but if I run the entire test suite with
Castle as default proxy factory, 2 tests fail, NH1080 and NH1789. Don't know
if that is a problem though... DS.

Reply via email to