You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by smartkid <sk...@gmail.com> on 2008/04/22 09:29:33 UTC
How to map a read-write property of a readonly object?
Hi,
The IBatis.NET does not support mapping a read-write property of a
readonly object.
public class MyNestedClass {
private String m_Value;
public String Value {
get { return m_Value; }
set { m_Value = value;}
}
}
public class MyClass {
private MyNestedClass m_Nested = new MyNestedClass();
//A readonly property, no setter needed.
public MyNestedClasss Nested {
get { return m_Nested; }
}
}
<resultmap class=”MyClass”>
…
<result property=”Nested.Value” column=”db_nested_col” …/>
</resultmap>
The mapping causes:
IBatisNet.Common.Exceptions.ProbeException: There is no Set member
named ‘Nested’ in class ‘MyClass’.
Is there a way to tell the ibatis.net to bypass finding the setter of the
‘Nested’ property ?
Smartkid