package Ġcom . w itk ups . car sharing . users . application Ċ Ċ import Ġcom . w itk ups . car sharing . users . user . Application User Ċ import Ġorg . hibernate . annotations . Check Ċ import Ġjavax . persistence .* Ċ Ċ @ Entity Ċ @ Table ( name Ġ= Ġ" route _ parts ") Ċ @ Check ( constraints Ġ= Ġ" depart ure Ġ<= Ġar rival ") Ċ data Ġclass ĠRoute Part ( ĊĠ Ġ@ Id ĊĠ Ġ@ Column ( name Ġ= Ġ" route _ part _ id ") ĊĠ Ġ@ GeneratedValue ( strategy Ġ= ĠGeneration Type . AUTO ) ĊĠ Ġvar Ġid : ĠLong ? Ġ= Ġnull , ĊĊĠ Ġ@ Column ( nullable Ġ= Ġfalse , Ġname Ġ= Ġ" route _ part _ order ") ĊĠ Ġvar Ġorder : ĠInt ? Ġ= Ġnull , ĊĊĠ Ġ@ Embedded ĊĠ Ġ@ Attribute Overrides ( ĊĠĠĠ ĠAttribute Override ( name Ġ= Ġ" date ", Ġcolumn Ġ= ĠColumn ( name Ġ= Ġ" depart ure ", Ġnullable Ġ= Ġfalse )), ĊĠĠĠ ĠAttribute Override ( name Ġ= Ġ" location _ id ", Ġcolumn Ġ= ĠColumn ( name Ġ= Ġ" origin ", Ġnullable Ġ= Ġfalse )) ĊĠ Ġ) ĊĠ Ġ@ Association Override ( ĊĠĠĠ Ġname Ġ= Ġ" location ", Ġjoin Columns Ġ= Ġ[ ĊĠĠĠ ĠJoin Column ( name Ġ= Ġ" origin _ id ", Ġnullable Ġ= Ġfalse , Ġup datable Ġ= Ġfalse , ĊĠĠĠĠĠ Ġforeign Key Ġ= ĠForeign Key ( name Ġ= Ġ" FK _ ROUTE _ PART S _ ORIGIN _ ID ")) ĊĠ Ġ]) ĊĠ Ġvar Ġorigin : ĠRoute Snapshot ? Ġ= Ġnull , ĊĊĠ Ġ@ Embedded ĊĠ Ġ@ Attribute Overrides ( ĊĠĠĠ ĠAttribute Override ( name Ġ= Ġ" date ", Ġcolumn Ġ= ĠColumn ( name Ġ= Ġ" arrival ", Ġnullable Ġ= Ġfalse )), ĊĠĠĠ ĠAttribute Override ( name Ġ= Ġ" location _ id ", Ġcolumn Ġ= ĠColumn ( name Ġ= Ġ" destination _ id ", Ġnullable Ġ= Ġfalse )) ĊĠ Ġ) ĊĠ Ġ@ Association Override ( ĊĠĠĠ Ġname Ġ= Ġ" location ", Ġjoin Columns Ġ= Ġ[ ĊĠĠĠ ĠJoin Column ( name Ġ= Ġ" destination _ id ", Ġnullable Ġ= Ġfalse , Ġup datable Ġ= Ġfalse , ĊĠĠĠĠĠ Ġforeign Key Ġ= ĠForeign Key ( name Ġ= Ġ" FK _ ROUTE _ PART S _ DEST INATION _ ID ")) ĊĠ Ġ]) ĊĠ Ġvar Ġdestination : ĠRoute Snapshot ? Ġ= Ġnull , ĊĊĠ Ġ@ Column ( nullable Ġ= Ġfalse ) ĊĠ Ġvar Ġdistance : ĠDouble ? Ġ= Ġnull , ĊĊĠ Ġ@ Column ( nullable Ġ= Ġfalse ) ĊĠ Ġvar Ġcost : ĠDouble ? Ġ= Ġnull , ĊĊĠ Ġ@ ManyToMany ( fetch Ġ= ĠFetch Type . LA ZY ) ĊĠ Ġ@ Join Table ( name Ġ= Ġ" route _ part _ pass engers ", ĊĠĠĠ Ġjoin Columns Ġ= Ġ[( JoinColumn ( name Ġ= Ġ" route _ part _ id ", Ġforeign Key Ġ= ĠForeign Key ( name Ġ= Ġ" FK _ APP _ USER _ ROUTE _ PART "))) ], ĊĠĠĠ Ġinverse Join Columns Ġ= Ġ[( JoinColumn ( name Ġ= Ġ" user _ id ", Ġforeign Key Ġ= ĠForeign Key ( name Ġ= Ġ" FK _ ROUTE _ PART _ APP _ USER ")) )] ĊĠ Ġ) ĊĠ Ġvar Ġpass engers : ĠMutable Set < Application User > Ġ= Ġmutable Set Of () Ċ ) Ċ