title: How can I use MySQL JSON functions with Mybatis?
body: <p>I'm trying to use MySQL JSON functions with Mybatis.</p>
  
  <pre class="lang-java prettyprint-override"><code>@Results(id = "findTestByCountry", value = {
          @Result(property = "id", column = "id", id = true)
      })
  @Select("SELECT id" +
          "FROM tests" +
          "WHERE JSON_CONTAINS(countries, #{country})")
  List&lt;Test&gt; findTestByCountry(String country);
  </code></pre>
  
  <p>But it fails like below.</p>
  
  <pre><code>Error querying database.  Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Invalid JSON text in argument 1 to function json_contains: "Invalid value." at position 0.
  </code></pre>
  
  <p>Is it impossible to use JSON functions with Mybatis?</p>