package Ġio . spark led . persistence . song . impl Ċ Ċ import Ġio . spark led . model . entity . Song Ċ import Ġio . spark led . persistence . Query Factory Ċ import Ġio . spark led . persistence . song . Song Persistence Service Ċ import Ġio . spark led . persistence . song . impl . query . Delete S ongs Query Ċ import Ġio . spark led . persistence . song . impl . query . GetAll S ongs Query Ċ import Ġio . spark led . persistence . song . impl . query . Get Song ById Query Ċ import Ġio . spark led . persistence . song . impl . query . Get Song By Sequence Id Query Ċ import Ġio . spark led . persistence . song . impl . query . Save Song Audio Query Ċ import Ġio . spark led . persistence . song . impl . query . Save Song Query Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠSong Persistence ServiceImpl Ċ @ Inject Ġconstructor ( private Ġval Ġquery Factory : ĠQuery Factory ) Ġ: ĠSong Persistence Service Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Song ( song : ĠSong , Ġaudio Data : ĠByteArray ): ĠSong Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsaved Song Ġ= ĠSave Song Query ( song ). perform ( query Factory ) ĊĠĠĠĠĠĠĠ ĠSave Song Audio Query ( saved Song , Ġaudio Data ). perform ( query Factory ) ĊĠĠĠĠĠĠĠ Ġreturn Ġsaved Song ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetAll S ongs (): ĠList < Song > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠGetAll S ongs Query (). perform ( query Factory ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Song ById ( song Id : ĠInt ): ĠSong ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠGet Song ById Query ( song Id ). perform ( query Factory ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Song By Sequence Id ( sequence Id : ĠInt ): ĠSong ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠGet Song By Sequence Id Query ( sequence Id ). perform ( query Factory ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġdelete Song ( song Id : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ ĠDelete S ongs Query ( listOf ( song Id )). perform ( query Factory ) ĊĠĠĠ Ġ} Ċ } Ċ