title: MyBatis Cassandra Result Set Map
body: <p>We are using MyBatis-Spring to manage DBMS transactions (Cassandra). Within Cassandra we have a table defined with a map column, which serves as a Partition Key (our keys have to be a complex type, so changing this is not an option).</p>
  
  <pre><code>CREATE TABLE mykeyspace.mytable ( name text, level frozen&lt;map&lt;text,text&gt;&gt;, effective_ts timestamp ... PRIMARY KEY ((name, level), effective_ts))
  </code></pre>
  
  <p>If I execute a query against Cassandra in csqlsh as follows I get a result back (i.e. the correct result set expected).</p>
  
  <pre><code>SELECT * FROM mykeyspace.mytable where name = 'somename' and level = {'mykey','myvalue'} ;
  </code></pre>
  
  <p>However, when executing this through MyBatis, I get no results back. The query is not throwing any exceptions, and I can clearly see the query in the logs from the MyBatis framework matches that which I have used in the cqlsh prompt.</p>
  
  <pre><code>01/11/2017 14:35:24:644 [DEBUG] getSetForName - ==&gt;  Preparing: SELECT * FROM mykeyspace.mytable WHERE NAME = 'somename' AND LEVEL = {'mykey':'myvalue'} 
  01/11/2017 14:35:24:777 [DEBUG] getValueSetForParameterSet - ==&gt; Parameters: 
  01/11/2017 14:35:24:890 [DEBUG] getValueSetForParameterSet - &lt;==      Total: 0
  01/11/2017 14:35:24:890 [DEBUG] SqlSessionUtils - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@22b1651]
  </code></pre>
  
  <p>Another note I attempted to use the DataStax driver core (i.e. executing the query without MyBatis) and got the expected result set as well. Therefore, my issue has to be related to MyBatis, but I've exhausted all ideas at this point. Any thoughts or suggestions?</p>
  
  <p>For reference... Mapper configuration...</p>
  
  <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.mycompany.mapper.MyMapper"&gt;
  
      &lt;select id="getSetForName" resultType="string" parameterType="map"&gt;
          SELECT * FROM MYKEYSPACE.MYTABLE WHERE NAME = '${name}' AND LEVEL = ${level}
      &lt;/select&gt;
  
  &lt;/mapper&gt;
  </code></pre>
  
  <p>For reference... Using the DataStax core API... </p>
  
  <pre><code>    private Cluster cluster;
      private Session session;
  
      public void doQuery(String name, String level) {
        String query = "select * from mykeyspace.mytable where name = '" + name + "' and level = " + level;
  
       Session s = get Session();
       ResultSet results = s.execute(query);
  
       for(Row r: results) {
         ...
       }
      }
  
      private Session getSession() {
        cluster = connectCluster("myhost");
        session = cluster.connect();
  
        return session;
      }
  
      private Cluster connectCluster(String node) {
        return Cluster.builder().addContactPoint(node).build();
      }
  </code></pre>
  
  <p>Version Info: mybatis-spring 1.3, mybatis v3.4.1, spring 4.3.4-RELEASE</p>