title: MyBatis - constructorArgs annotation and embedded objects
body: <p>Is it possible to map embedded object with annotation using MyBatis in one query i.e.:<br/>Foo class:
  <code></p>
  
  <pre><code>public class Foo //immutable
  {
  private final Integer fooId;
  private final String fooAttr;
  private final Bar bar;
  public Foo(Integer fooId, String fooAttr, Bar bar) //constructor
  }
  </code></pre>
  
  <p></code>
  Bar class:
  <code></p>
  
  <pre><code> public class Bar { //immutable
   private final Integer barId;
   private final String barAttr;
   public Bar(Integer barId, String barAttr) //constructor
  }
  </code></pre>
  
  <p></code>
  Table FooBar:
  <code></p>
  
  <pre><code>- INT foo_id
  - CHAR foo_attr
  - INT bar_id
  - CHAR bar_attr
  </code></pre>
  
  <p></code>
  Query:
  <code></p>
  
  <pre><code>@ConstructorArgs({
    @Arg(column="foo_id", javaType=Integer.class),
    @Arg(column="foo_attr", javaType=String.class),
    Bar ?
  })
  Select("select * from FooBar where foo_id=#{fooId}"
  public Foo getFooBy(@Param("fooId") Integer fooId);
  </code></pre>
  
  <p></code>
  How to map Bar class as Foo constructor argument (without using subqueries) ?</p>