Mapping a result set (of two integers) in mybatis?
<p>I have the following stored procedure - simply returning two integers for now : </p>

<pre><code>USE [DB_NAME_HERE]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create PROCEDURE [dbo].[PR_PROCEDURE_NAME]
SELECT 0 AS ValueA,0 AS ValueB
</code></pre>

<p>and I have the following mapper XML : </p>

<pre><code>  &lt;resultMap id="BaseResultMap" type="com.companyname.service.mybatis.model.modelClass"&gt;
    &lt;result column="ValueA" jdbcType="INTEGER" property="valueA" /&gt;
    &lt;result column="ValueB" jdbcType="INTEGER" property="valueB" /&gt;
  &lt;/resultMap&gt;

  &lt;select id="getPurgedTokens" resultMap="BaseResultMap" statementType="CALLABLE"&gt;
      {call PR_PROCEDURE_NAME(
          #{resultContainer.valueA, mode=OUT, jdbcType=INTEGER},
          #{resultContainer.valueB, mode=OUT, jdbcType=INTEGER}
      )}
  &lt;/select&gt;
</code></pre>

<p>Then I have the following java class for the mapping : </p>

<pre><code>public class modelClass implements Serializable {

    private int valueA;
    private int valueB;

    public int getValueA() { return this.valueA; }
    public void setValueA(int valueA) { this.valueA = valueA; }

    public int getValueB() { return this.valueB; }
    public void setValueB(int valueB) { this.valueB= valueB; }
}
</code></pre>

<p>But when I run up my application, and attempt to get any kind of data, I get the following error : </p>

<pre><code>code=DataIntegrityViolationException,messages=[SqlSession operation; SQL []; Invalid JDBC call escape at line position 10.; nested exception is java.sql.SQLException: Invalid JDBC call escape at line position 10., Invalid JDBC call escape at line position 10.]]
</code></pre>

<p>All help here is greatly appreciated - I have been trying to get this working for days!</p>

<p>EDIT : UPDATE WITH EXACT COPIES OF LATEST CODE!</p>

<h2>MapperXML</h2>

<pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"&gt;
    &lt;mapper namespace="com.company.product.mybatis.mappers.MapperXML"&gt;

    &lt;!-- Commented out the base result map because now we link directly in the paramter type? --&gt;

    &lt;!--
    &lt;resultMap id="BaseResultMap" type="com.companyname.service.mybatis.model.modelClass"&gt;
    &lt;result column="ValueA" javaType="java.lang.Integer" jdbcType="INTEGER" property="valueA"/&gt;
    &lt;result column="ValueB" javaType="java.lang.Integer" jdbcType="INTEGER" property="valueB"/&gt;
  &lt;/resultMap&gt;--&gt;

  &lt;!-- -------------------------------------------- --&gt;

  &lt;select id="getPurgedTokens" parameterType="com.companyname.service.mybatis.model.ModelClass" statementType="CALLABLE"&gt;
    {call PR_TokenPurge_Clean(
      #{dvalueA, mode=OUT, jdbcType=INTEGER},
      #{valueB, mode=OUT, jdbcType=INTEGER}
    )}
  &lt;/select&gt;
&lt;/mapper&gt;
</code></pre>

<h2>ModelClass</h2>

<pre><code>package com.companyname.service.mybatis.model;

import java.io.Serializable;

public class ModelClass implements Serializable {

    private int valueA;
    private int valueB;


    public int getVavlueA() { return this.valueA; }
    public void setValueA(int valueA) { this.valueA = valueA; }

    public int getValueB() { return this.valueB; }
    public void setValueB(int valueB) { this.valueB = valueB; }
}
</code></pre>

<h2>DAO</h2>

<pre><code>package com.company.product.dao.mybatis;

[imports (removed for brevity and security)...]


@Repository
public class ModelClassDaoMybatis implements ModelClassDao {

    private TokenPurgeModelMapper tokenPurgeModelMapper;
    private SqlSessionOperations sqlSessionOperations;

    @Override
    public TokenPurgeModel purgeTokens()
    {
        if (this.sqlSessionOperations.selectOne(".getPurgedTokens") != null)
        {
            System.out.println("I FOUND A VALUE!!!!!!");
            return (TokenPurgeModel) sqlSessionOperations.selectOne(testing);
        }
        else
        {
            System.out.println("No value found for select statement");
            return null;
        }
    }

    @Override
    public List&lt;TokenPurgeModel&gt; getPurgedTokens() {
        return tokenPurgeModelMapper.getPurgedTokens();
    }

    @Required
    public void setTokenPurgeModelMapper(final TokenPurgeModelMapper tokenPurgeMapper) {
        this.tokenPurgeModelMapper = tokenPurgeMapper;
    }
    @Required
    public void setSqlSessionOperations(SqlSessionOperations sqlSessionOperations) {
        this.sqlSessionOperations = sqlSessionOperations;
    }
}
</code></pre>

<h2>MODEL MAPPER CLASS</h2>

<pre><code>package com.company.product.mybatis.mappers;


[imports (removed for brevity and security)...]

public interface TokenPurgeModelMapper {

    // This is the one I am using right now. (as seen in the DAO!)
    TokenPurgeModel purgeTokens();

    // Get the list of tokens which have been removed from the PAN table.
    List&lt;TokenPurgeModel&gt; getPurgedTokens(); // This is actually never used - will be used in later funcationality!
}
</code></pre>

<p>THANKS for looking at this for me!</p>