package Ġcom . line corp . kotlin jd sl . query . clause . groupby Ċ Ċ import Ġcom . line corp . kotlin jd sl . query . spec . From s Ċ import Ġcom . line corp . kotlin jd sl . query . spec . expression . Expression Spec Ċ import Ġjavax . persistence . criteria . Abstract Query Ċ import Ġjavax . persistence . criteria . Criteria Builder Ċ import Ġjavax . persistence . criteria . Criteria Query Ċ import Ġjavax . persistence . criteria . Sub query Ċ Ċ /** Ċ Ġ* ĠInternal ĠOnly Ċ Ġ* ĠDon 't Ġuse Ġthis Ġdirectly Ġbecause Ġit 's Ġan Ġ** INTERNAL **. Ċ Ġ* ĠIt Ġdoes Ġnot Ġsupport Ġbackward Ġcompatibility . Ċ Ġ*/ Ċ data Ġclass ĠGroup By Clause ( ĊĠĠĠ Ġprivate Ġval Ġexpressions : ĠList < Expression Spec <* >>, Ċ ) Ġ: ĠCriteria Query GroupBy Clause , ĠSub query GroupBy Clause Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġapply ( from s : ĠFrom s , Ġquery : ĠCriteria Query <* >, Ġcriteria Builder : ĠCriteria Builder ) Ġ{ ĊĠĠĠĠĠĠĠ Ġapply Intern ally ( from s , Ġquery , Ġcriteria Builder ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġapply ( from s : ĠFrom s , Ġquery : ĠSub query <* >, Ġcriteria Builder : ĠCriteria Builder ) Ġ{ ĊĠĠĠĠĠĠĠ Ġapply Intern ally ( from s , Ġquery , Ġcriteria Builder ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġapply Intern ally ( from s : ĠFrom s , Ġquery : ĠAbstract Query <* >, Ġcriteria Builder : ĠCriteria Builder ) Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( expressions . isEmpty ()) Ġreturn ĊĊĠĠĠĠĠĠĠ Ġquery . groupBy ( expressions . map Ġ{ Ġit . to Criteria Expression ( from s , Ġquery , Ġcriteria Builder ) Ġ}) ĊĠĠĠ Ġ} Ċ } Ċ