I have a query:
select id, thing
from example
order by id
I need to map this into a list of objects like this:
class Example
{
public int id;
public List<Thing> things;
}
"Thing" is custom object with no setters. There is a registered type handler to create a thing from a column, which works perfectly with individual result mappings.
I am trying to create a mapper that will handle this.
<resultMap id="exampleMap" type="Example">
<id property="id" column="id"/>
<collection property="names" ofType="Thing">
....
</collection>
</resultMap>
My problem is that I have no idea what would go in the body of the collection. All of the examples revolve around complex types.
Is this even possible?