Hi

I was wondering if any one could provide any pointers on how I might map an 
SqlServer Xml data type using Ibatis.

I am using the following: -

CREATE TABLE [dbo].[Reports](
                [ID] [int] IDENTITY(1,1) NOT NULL,
                [Config] [xml] NOT NULL
) ON [PRIMARY]

Part of my sqlMap is as follows: -

...
<resultMaps>
       <resultMap id="SelectResult" class="Report">
              <result property="Id" column="ID"/>
              <result property="Config" column="Config" />
       </resultMap>
</resultMaps>
<statements>
       <select id="GetReport" parameterClass="int" 
resultMap="SelectResult">select * from dbo.Reports where ID = #Id#</select>
       <select id="GetReportList" parameterClass="int" 
resultMap="SelectResult">select * from dbo.Reports</select>
         ...
</statements>
...

I was planning on my object along the lines of: -

public class report {
       ...
       public SqlXml Config { .. }
}

But I suspect I need to somehow deal with a Binary stream.

Any help would be greatly appreciated.

Thanks in advance
Blair

Reply via email to