Without groupBy in your resultMap, you'll end up with 3 parent objects, each with one child. What you wanted was 2 parents, one with three children.
Sorry, that should read 'end up with 4 parent objects'. I'm clearly having a bad day...
Without groupBy in your resultMap, you'll end up with 3 parent objects, each with one child. What you wanted was 2 parents, one with three children.