package Ġbe . yellow duck . sport s . model Ċ Ċ import Ġorg . springframework . data . jpa . repository . Query Ċ import Ġorg . springframework . data . repository . Crud Repository Ċ Ċ interface ĠRoute Repository Ġ: ĠCr ud Repository < Route , ĠLong > Ġ{ ĊĊĠĠĠ Ġfun ĠfindAll By OrderBy Changed At Desc (): ĠIterable < Route > ĊĊĠĠĠ Ġfun ĠfindAll By Sport OrderBy Changed At Desc ( sport : ĠString ): ĠIterable < Route > ĊĊĠĠĠ Ġ@ Query (" SELECT Ġnew Ġbe . yellow duck . sport s . model . Summary ( sport , Ġcount (*) ĠAS Ġcount ) ĠFROM Ġroutes ĠGROUP ĠBY Ġs port ĠORDER ĠBY Ġs port ") ĊĠĠĠ Ġfun Ġfind Sport sWith Count (): ĠIterable < Summary > ĊĊĠĠĠ Ġ@ Query (" SELECT Ġcount (*) ĠFROM Ġroutes ĠWHERE Ġtoken _ id Ġ= Ġ? 1 ") ĊĠĠĠ Ġfun Ġfind Total Route Count ( tokenId : ĠLong ): ĠLong ĊĊĠĠĠ Ġ@ Query (" SELECT Ġr ĠFROM Ġroutes Ġr ĠWHERE Ġr . distance ĠBETWEEN Ġ? 1 ĠAND Ġ? 2 ") ĊĠĠĠ Ġfun ĠfindAll With Distance Range ( min Distance : ĠDouble , Ġmax Distance : ĠDouble ) Ġ: ĠIterable < Route > Ċ Ċ }