generate ToMany context comporators