How to map one-to-many relationships in myBatis?
<p>So I have the following table that I must map to Java Objects:</p>

<pre><code>+---------+-----------+---------------------+---------------------+--------+
| task_id | attribute | lastModified        | activity            | row_id |
+---------+-----------+---------------------+---------------------+--------+
|       1 |         1 | 2016-08-23 21:05:09 | first activity      |      1 |
|       1 |         3 | 2016-08-23 21:08:28 | connect to db       |      2 |
|       1 |         3 | 2016-08-23 21:08:56 | create web services |      3 |
|       1 |         4 | 2016-08-23 21:08:56 | data dump           |      4 |
|       1 |         5 | 2016-08-23 21:08:56 | test cases          |      5 |
|       1 |         6 | 2016-08-23 21:08:57 | dao object          |      6 |
|       1 |         7 | 2016-08-23 21:08:57 | buy streetfood      |      7 |
|       2 |         6 | 2016-08-23 21:08:57 | drink coke          |      8 |
|       2 |         6 | 2016-08-23 21:09:00 | drink tea           |      9 |
|       2 |         1 | 2016-08-23 21:12:30 | make tea            |     10 |
|       2 |         2 | 2016-08-23 21:13:32 | charge phone        |     11 |
|       2 |         3 | 2016-08-23 21:13:32 | shower              |     12 |
|       2 |         4 | 2016-08-23 21:13:32 | sleep               |     13 |
+---------+-----------+---------------------+---------------------+--------+
</code></pre>

<p>Here, each <code>Task</code> object( identified by the <code>task_id</code> column) has multiple <code>attribute</code> objects. These attribute objects have the <code>lastModified</code>, and <code>activity</code> fields. So far my approach has been to create a <code>Row</code> object have each row of the table mapped to a <code>Row</code> object via myBatis. Then do some Java-side processing to sort everything out. Is there a way to directly map this table via myBatis annotations and/or xml so that the 2 Task objects are created with each of them having a list of populated Atttribute objects inside?</p>