You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Bhaarat Sharma <bh...@gmail.com> on 2009/09/24 20:00:33 UTC

using iBatis for API

Hello,

Apologies if this question sounds weird.

We are in a system where we use stored procedures extensively.  We use
iBatis for this.  However, now we are provided with API's so instead
of using stored procedures we will be using the api's.  As a result,
we will have to convert all our code that is in iBatis to use the API.

Before starting on that I wanted to inquire if there was any way
possible to use iBatis to call the API method instead of calling the
Stored Procedure? that way our lives will be much simpler since we
wont have to change existing code a lot.

As an example. Here is the iBatis mapping for one of the SP's:
    <parameterMap id="getOHUserNameDetailsParm" class="map">
        <parameter property="userId" jdbcType="String"
javaType="java.lang.String" mode="IN"/>
    </parameterMap>

    <resultMap id="getOHUserNameDetailsResults" class="java.util.HashMap">
        <result property="firstName" column="user_first_name"/>
        <result property="middleIni" column="user_mi"/>
        <result property="lastName" column="user_last_name"/>
    </resultMap>

    <procedure id="getOHUserNameDetails"
parameterMap="getOHUserNameDetailsParm"
resultMap="getOHUserNameDetailsResults">
        {call sp_read_user(?)}
    </procedure>

the API method for this will be:
Name		: getUser
Parameter	        : userID
EJB		        : UserManager
Input:
Parameter	      Data_Type	      Description
userID	      String	              User ID (mandatory)
Output:
Parameter	      Data_Type	      Description
User Object     User	              User Object List

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org