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 "LITTLEWOOD, John, GBM" <Jo...@rbos.com> on 2007/02/01 20:24:43 UTC
result maps and complex property
I am using .net and Oracle. (using the .net oracle as provider.)
here is my xml mapping
<?xml version="1.0" encoding="utf-8" ?>
<sqlMap
namespace="StaticHeader"
xmlns="http://ibatis.apache.org/mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- XML document for the Static Header class. -->
<alias>
<typeAlias alias="StaticHeader" />
<typeAlias alias="StaticDetail" />
</alias>
<resultMaps>
<resultMap id="StaticHeader-Result" class="StaticHeader">
<result property="StaticHeadersId" column="STATIC_HEADERS_ID" />
<result property="FullDesc" column="FULL_DESC" />
<result property="AuditComment" column="AUDIT_COMMENT" />
<result property="AuditEmpId" column="AUDIT_EMP_ID" />
<result property="AuditWhen" column="AUDIT_WHEN" />
<result property="AuditWho" column="AUDIT_WHO" />
<result property="AuditVersionNo" column="AUDIT_VERSION_NO" />
<result property="StaticDetails" column="STATIC_HEADERS_ID"
select="StaticHeader.StaticHeader-GetStaticDetail"/>
</resultMap>
<resultMap id="StaticDetails-Result" class="StaticDetail">
<result property="StaticDetailsId" column="STATIC_DETAILS_ID" />
<result property="StaticHeadersId" column="STATIC_HEADER_ID" />
<result property="FullDesc" column="FULL_DESC" />
<result property="ShortDesc" column="SHORT_DESC" />
<result property="AuditComment" column="AUDIT_COMMENT" />
<result property="AuditEmpId" column="AUDIT_EMP_ID" />
<result property="AuditWhen" column="AUDIT_WHEN" />
<result property="AuditWho" column="AUDIT_WHO" />
<result property="AuditVersionNo" column="AUDIT_VERSION_NO" />
</resultMap>
</resultMaps>
<statements>
<procedure id="StaticHeader-GetStaticHeader"
parameterMap="StaticHeader-Select" resultMap="StaticHeader-Result">
PKG_TEST.jackie1
</procedure>
<procedure id="StaticHeader-GetStaticDetail"
parameterMap="StaticDetail-Select" resultMap="StaticDetails-Result">
PKG_TEST.jackie2
</procedure>
</statements>
<parameterMaps>
<parameterMap id="StaticHeader-Select">
<parameter property="p_id" column="p_id" direction="Input" dbtype="Int32"/>
<parameter property="p_out" column="p_out" direction="Output"
dbtype="RefCursor" />
</parameterMap>
<parameterMap id="StaticDetail-Select" >
<parameter property="StaticHeadersId" column="p_id" direction="Input"
dbtype="Int32"/>
<parameter property="p_out" column="p_out" direction="Output"
dbtype="RefCursor" />
</parameterMap>
</parameterMaps>
</sqlMap>
on my pageload of my UI code I have this piece of code
protected void Page_Load(object sender, EventArgs e)
{
ISqlMapper mapper = null;
DomSqlMapBuilder builder = new DomSqlMapBuilder();
mapper = builder.Configure("sqlMap.config");
Hashtable param = new Hashtable();
param.Add("p_id", 1);
param.Add("p_out", null);
StaticHeader oSH = null;
oSH =
mapper.QueryForObject<StaticHeader>("StaticHeader.StaticHeader-GetStaticHead
er", param);
Label1.Text = oSH.FullDesc;
Label2.Text = oSH.StaticHeadersId.ToString();
GridView1.DataSource = oSH.StaticDetails;
GridView1.DataBind();
}
The parent populates and so does the child but I get the following error
I trace through the Ibatis code, hence how I know that both the parent an
dchild are getting populated. However, this is the error message I get.
So near and yet so far :-((
Many thanks
***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
Authorised and regulated by the Financial Services Authority
This e-mail message is confidential and for use by the
addressee only. If the message is received by anyone other
than the addressee, please return the message to the sender
by replying to it and then delete the message from your
computer. Internet e-mails are not necessarily secure. The
Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent.
Whilst all reasonable care has been taken to avoid the
transmission of viruses, it is the responsibility of the recipient to
ensure that the onward transmission, opening or use of this
message and any attachments will not adversely affect its
systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry
out such virus and other checks as it considers appropriate.
Visit our websites at:
www.rbs.com
www.rbsgc.com
www.rbsmarkets.com
***********************************************************************************