package Ġcom . bs ch and ram oh an . learn . spring connect . spring boot console . repository Ċ Ċ import Ġcom . bs ch and ram oh an . learn . spring connect . spring boot console . entity . Student Ċ import Ġorg . springframework . stereotype . Repository Ċ Ċ @ Repository Ċ class ĠStudent Repository Impl Ġ: ĠStudent Repository Ġ{ ĊĠĠĠ Ġ// ĠFor Ġdemo Ġpurpose , Ġstoring Ġin Ġin - memory Ġvariable ĊĠĠĠ Ġvar Ġstudent Database Ġ= Ġmutable Map Of < Long , ĠStudent >() ĊĊĠĠĠ Ġoverride Ġfun Ġget ( id : ĠLong ): ĠStudent Ġ= Ġstudent Database [ id ] Ġ?: Ġthrow ĠException (" Student Ġwith ĠID Ġdoesn 't Ġexist ") ĊĊĠĠĠ Ġoverride Ġfun Ġlist (): ĠList < Student > Ġ= Ġstudent Database . values . toList () ĊĊĠĠĠ Ġoverride Ġfun Ġsave ( student : ĠStudent ): ĠStudent Ġ{ ĊĠĠĠĠĠĠĠ Ġstudent Database [ student . id ] Ġ= Ġstudent ĊĠĠĠĠĠĠĠ Ġreturn Ġstudent Database [ student . id ] Ġ?: Ġthrow ĠException (" Error Ġin Ġstudent Ġsave ") ĊĠĠĠ Ġ} Ċ }