package Ġhello Ċ Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġorg . springframework . boot . CommandLine Runner Ċ import Ġorg . springframework . boot . Spring Application Ċ import Ġorg . springframework . boot . autoconfigure . SpringBoot Application Ċ import Ġorg . springframework . context . annotation . Bean Ċ Ċ @ SpringBoot Application Ċ class ĠApplication Ġ{ ĊĊ ĉ private Ġval Ġlog Ġ= ĠLoggerFactory . getLogger ( Application :: class . java ) ĊĊ ĉ @ Bean Ċ ĉ fun Ġinit ( repository : ĠCustomer Repository ) Ġ= ĠCommandLine Runner Ġ{ Ċĉĉ ĉ // Ġsave Ġa Ġcouple Ġof Ġcustomers Ċĉĉ ĉ repository . save ( Customer (" H endi ", Ġ" S ant ika ")) Ċĉĉ ĉ repository . save ( Customer (" S as uke ", Ġ" U chi ha ")) Ċĉĉ ĉ repository . save ( Customer (" Uz um aki ", Ġ" N ar uto ")) Ċĉĉ ĉ repository . save ( Customer (" S ak ura ", Ġ" Har uno ")) Ċĉĉ ĉ repository . save ( Customer (" H ata ke ", Ġ" K akash i ")) ĊĊĉ ĉ // Ġfetch Ġall Ġcustomers Ċĉ ĉ log . info (" Customers Ġfound Ġwith ĠfindAll (): ") Ċĉ ĉ log . info (" ---------------- --------------- ") Ċĉ ĉ for Ġ( customer Ġin Ġrepository . findAll ()) Ġ{ Ċĉĉ ĉ log . info ( customer . toString ()) Ċĉ ĉ } Ċĉ ĉ log . info ("") ĊĊĉ ĉ // Ġfetch Ġan Ġindividual Ġcustomer Ġby ĠID Ċĉ ĉ val Ġcustomer Ġ= Ġrepository . findById ( 1 L ) Ċĉ ĉ log . info (" Customer Ġfound Ġwith Ġfind ById ( 1 L ): ") Ċĉ ĉ log . info (" -------------------------------- ") Ċĉ ĉ log . info ( customer . toString ()) Ċĉ ĉ log . info ("") ĊĊĉ ĉ // Ġfetch Ġcustomers Ġby Ġlast Ġname Ċĉ ĉ log . info (" Customer Ġfound Ġwith ĠfindBy LastName (' N ar uto '): ") Ċĉ ĉ log . info (" -------------------------------- ------------ ") Ċĉ ĉ for Ġ( N ar uto Ġin Ġrepository . findBy LastName (" N ar uto ")) Ġ{ Ċĉĉ ĉ log . info ( N ar uto . toString ()) Ċĉ ĉ } Ċĉ ĉ log . info ("") Ċ ĉ } Ċ Ċ } Ċ Ċ fun Ġmain ( args : ĠArray < String >) Ġ{ Ċ ĉ Spring Application . run ( Application :: class . java , Ġ* args ) Ċ } Ċ