title: How to set argument in myBatis mapper from another mapper
body: <p>I have some problems with mapping in myBatis.</p>
  
  <p>I have pojo class </p>
  
  <pre><code>public class Video {
      private int id;
      private String title;
      private Set&lt;Person&gt; actors;
      ...
      getters &amp; setters
  }
  </code></pre>
  
  <p>I'm have interface PersonMapper</p>
  
  <pre><code>public interface PersonMapper {
  @Select("${query}")
      Set&lt;Person&gt; getByFilmId(@Param("id") long id, @Param("query") PersonByFilmQueries query);
  
  enum PersonByFilmQueries {
  
          ACTORS_BY_FILM(
                  "select " +
                  "   * " +
                  "from " +
                  "   actors a, " +
                  "   film_actors fa " +
                  "where " +
                  "   fa.actor_id = a.id " +
                  "and fa.film_id = #{id}"),
          ....
          WRITERS_BY_FILM(
                  "select "+
                  "* " +
                  "from " +
                  "writers w, " +
                  "film_writers fw " +
                  "where " +
                  "fw.writer_id = w.id " +
                  "and fw.film_id = #{id}");
          private String query;
  
          PersonByFilmQueries(String query) {
              this.query = query;
          }
  
          @Override
          public String toString() {
              return query;
          }
      }
  }
  </code></pre>
  
  <p>I am try to reuse this select from another xml mapper (VideoMapper.xml). </p>
  
  
  
  <p></p>
  
  <pre><code>&lt;mapper namespace="ru.common.mapper.VideoMapper"&gt;
      &lt;resultMap id="video" type="Video"&gt;
      &lt;id property="id" column="id"/&gt;
      &lt;result property="title" column="title"/&gt;
      &lt;/resultMap&gt;
      &lt;collection property="actors" javaType="HashSet" ofType="Person" column="id" 
      select="ru.common.mapper.PersonMapper.getByFilmId"&gt;
      &lt;/collection&gt;
  &lt;/resultMap&gt; 
  </code></pre>
  
  <p>I'm trying to add a collection of Person to Video POJO.
  But I do not understand how to set the second argument in getByFilmId enum with sql. 
  Is there any easy way to do this?
  If I call this mapper from Java then there are no problems, everything works</p>