package Ġdev . fre der ik . dr am atis person ae . model Ċ Ċ import Ġorg . springframework . data . repository . Crud Repository Ċ import Ġjava . util .* Ċ import Ġjavax . persistence .* Ċ Ċ @ Entity Ċ data Ġclass ĠEvent ( ĊĠĠĠ Ġvar Ġname : ĠString , ĊĠĠĠ Ġvar Ġordinal : ĠInt , ĊĠĠĠ Ġ@ Column ( column Definition Ġ= Ġ" TEXT ") Ġvar Ġdescription : ĠString , ĊĠĠĠ Ġ@ ManyToOne Ġvar Ġcampaign : ĠCampaign , ĊĠĠĠ Ġ@ ManyToMany Ġ@ Join Table ( ĊĠĠĠĠĠĠĠ Ġname Ġ= Ġ" event _ character ", ĊĠĠĠĠĠĠĠ Ġinverse Join Columns Ġ= Ġ[ JoinColumn ( name Ġ= Ġ" character _ id ")] ĊĠĠĠ Ġ) Ġvar Ġcharacters : ĠMutable List < Character > Ġ= Ġmutable ListOf (), ĊĠĠĠ Ġ@ ManyToMany Ġ@ Join Table ( ĊĠĠĠĠĠĠĠ Ġname Ġ= Ġ" event _ location ", ĊĠĠĠĠĠĠĠ Ġinverse Join Columns Ġ= Ġ[ JoinColumn ( name Ġ= Ġ" location _ id ")] ĊĠĠĠ Ġ) Ġvar Ġlocations : ĠMutable List < Location > Ġ= Ġmutable ListOf (), ĊĠĠĠ Ġ@ Id Ġ@ GeneratedValue Ġvar Ġid : ĠUUID ? Ġ= Ġnull Ċ ) Ċ Ċ interface ĠEvent Repository Ġ: ĠCr ud Repository < Event , ĠUUID > Ġ{ ĊĠĠĠ Ġfun ĠfindAll By Campaign OrderBy Ordinal Asc ( campaign : ĠCampaign ): ĠList < Event > ĊĠĠĠ Ġfun ĠfindAll By Campaign OrderBy Ordinal Desc ( campaign : ĠCampaign ): ĠList < Event > ĊĠĠĠ Ġfun Ġfind Top By Campaign OrderBy Ordinal Desc ( campaign : ĠCampaign ): ĠOptional < Event > Ċ } Ċ