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 Mohammed Mudassir <mm...@gmail.com> on 2005/05/29 08:18:25 UTC

SQL Server + .NET Ibatis Issue

Hello! 

I setup my stuff with IBATIS to get the stuff from SQL Server using
the Stored Proc. Here is my SqlMap.xml:

<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace="Person"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="SqlMap.xsd">
	<!-- XML "behind" document for the People service class. -->
	<alias>
		<typeAlias alias="Publishers" type="IbatisBuraq.WebFace-SQL.Publishers" />
	</alias>
	<resultMaps>
		<resultMap id="SelectSPResult" class="Publishers">
			<result property="Name" column="Name" />
			<result property="CompanyName" column="CompanyName" />
			<result property="Address" column="Address" />
			<result property="City" column="City" />
			<result property="State" column="State" />
		</resultMap>
	</resultMaps>
	<procedure id="la_GetPublisher" parameterMap =
"get-publisher-param"></procedure>
	<parameterMap id="get-publisher-param" class=paramClass>
		<parameter property="paramCity" column="City"/>
	</parameterMap>


</sqlMap>


Over here i have a query , where should I tell the name of Stored Proc
name that is in my DB?

And is that SQL Map file is okay?

Take Care,

Mudassir
-- 

Mudassir

San Jose,CA

--------------------------------------------------------------------------------------------------------------------------

Hope is a good thing, maybe the best of things, and no good thing ever dies. 

- The Shawshank Redemption (Movie)

Re: SQL Server + .NET Ibatis Issue

Posted by Gilles Bayon <ib...@gmail.com>.
For a procedure just put the name of the query between the procedure tag.
Example form Nunit tests

<!-- For procedure, the parameters of the parameterMap must in the same 
order 
as for the procedure paramaters-->
<procedure id="InsertAccountViaStoreProcedure" parameterMap="insert-params">
ps_InsertAccount
</procedure>

<procedure id="SwapEmailAddresses" parameterMap="swap-params">
ps_swap_email_address
</procedure>

<procedure id="GetAccountViaSP" parameterMap="select-params" 
resultClass="Account">
ps_SelectAccount
</procedure>
Cheers, 
Gilles