title: myBatis. ResultMap and properties
body: <p>I am trying to use myBatis in my project. For the "Select" method, I used result map</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="resultMap"&gt;
      &lt;resultMap id="userMap" type="db.entities.User"&gt;
          &lt;result column="id" property="id"/&gt;
          &lt;result column="login" property="login"/&gt;
          &lt;result column="password" property="password"/&gt;
          &lt;result column="service_profile" property="serviceProfile.id"/&gt;
          &lt;result column="driver_profile" property="driverProfile.id"/&gt;
          &lt;result column="premium_expiring_time" property="premiumExpiringDate"/&gt;
          &lt;result column="registration_date" property="registrationDate"/&gt;
          &lt;result column="last_visit_date" property="lastVisitDate"/&gt;
          &lt;result column="authorization_key" property="authorizationKey"/&gt;
          &lt;result column="last_altitude" property="lastGeoAltitude"/&gt;
          &lt;result column="last_longitude" property="lastGeoLongitude"/&gt;
      &lt;/resultMap&gt;
  &lt;/mapper&gt;
  </code></pre>
  
  <p>And it works, when I get from my function's argument instance of my class</p>
  
  <pre><code>@ResultMap("resultMap.userMap")
      @Select("SELECT * FROM users WHERE login = #{login} AND password = #{password}")
      fun getUser(user: User): User?
  </code></pre>
  
  <p>But I think, that it is bad idea, because first I need to create User().
  When I try to use "login" and "password" in function's arguments, I take an exception:</p>
  
  <pre><code>org.apache.ibatis.exceptions.PersistenceException: 
  ### Error querying database.  Cause: org.apache.ibatis.binding.BindingException: Parameter 'login' not found. Available parameters are [arg1, arg0, param1, param2]
  ### Cause: org.apache.ibatis.binding.BindingException: Parameter 'login' not found. Available parameters are [arg1, arg0, param1, param2]
  </code></pre>
  
  <p>How can I use incoming arguments without creating instance of my class User?</p>