I have a SQL query with sub query:
<select id="selectOrdersWithDetails" resultMap="OrderResult">
select id as id,
(
select id
from order_items
) as itemIds
from orders
</select>
the next step, I want to map the itemIds
to entity, this is the entity defined like:
class OrderResult{
private String id;
private List<String> itemIds;
}
now I am using group_concat
to concat the item ids and using String to receive, and split the order item code in Java context. is it possible to set the id into itemIds
directly?