package Ġtop . z be boy . isy . service . intern ship Ċ Ċ import Ġorg . jooq . DSL Context Ċ import Ġorg . jooq . Record Ċ import Ġorg . jooq . Result Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . stereotype . Service Ċ import Ġorg . springframework . transaction . annotation . Propagation Ċ import Ġorg . springframework . transaction . annotation . Transactional Ċ Ċ import Ġtop . z be boy . isy . domain . Tables .* Ċ import Ġtop . z be boy . isy . domain . tables . da os . Intern ship Change History Dao Ċ import Ġtop . z be boy . isy . domain . tables . po jos . Intern ship Change History Ċ import Ġtop . z be boy . isy . domain . tables . records . Intern ship Change History Record Ċ import Ġjava . sql . Timestamp Ċ import Ġjavax . annotation . Resource Ċ Ċ /** Ċ Ġ* ĠCreated Ġby Ġz be boy Ġ 2 0 1 7 - 1 2 - 2 7 Ġ. Ċ Ġ**/ Ċ @ Service (" intern ship Change History Service ") Ċ @ Transactional ( propagation Ġ= ĠPro pagation . SUPPORT S , ĠreadOnly Ġ= Ġtrue ) Ċ open Ġclass ĠIntern ship Change History ServiceImpl Ġ@ Autowired Ġconstructor ( dsl Context : ĠDSL Context ) Ġ: ĠIntern ship Change History Service Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġcreate : ĠDSL Context Ġ= Ġd sl Context ĊĊĠĠĠ Ġ@ Resource ĊĠĠĠ Ġopen Ġlateinit Ġvar Ġintern ship Change History Dao : ĠIntern ship Change History Dao ĊĊĊĠĠĠ Ġ@ Transactional ( propagation Ġ= ĠPro pagation . REQUIRED , ĠreadOnly Ġ= Ġfalse ) ĊĠĠĠ Ġoverride Ġfun Ġsave ( intern ship Change History : ĠIntern ship Change History ) Ġ{ ĊĠĠĠĠĠĠĠ Ġintern ship Change History Dao . insert ( intern ship Change History ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġdelete By Intern ship Release Id And Student Id ( intern ship Release Id : ĠString , Ġstudent Id : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcreate . delete From < Intern ship Change History Record >( INTER N SHIP _ CHANGE _ HISTORY ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. where ( INTER N SHIP _ CHANGE _ HISTORY . INTER N SHIP _ RELEASE _ ID . eq ( intern ship Release Id ). and ( INTER N SHIP _ CHANGE _ HISTORY . ST UD ENT _ ID . eq ( student Id ))) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. execute () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠfindBy Intern ship Release Id And Student Id ( intern ship Release Id : ĠString , Ġstudent Id : ĠInt ): ĠResult < Record > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġcreate . select () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. from ( INTER N SHIP _ CHANGE _ HISTORY ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. join ( ST UD ENT ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. on ( INTER N SHIP _ CHANGE _ HISTORY . ST UD ENT _ ID . eq ( ST UD ENT . ST UD ENT _ ID )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. join ( ORG AN IZE ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. on ( ST UD ENT . ORG AN IZE _ ID . eq ( ORG AN IZE . ORG AN IZE _ ID )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. join ( USERS ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. on ( ST UD ENT . USERNAME . eq ( USERS . USERNAME )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. join ( INTER N SHIP _ RELEASE ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. on ( INTER N SHIP _ CHANGE _ HISTORY . INTER N SHIP _ RELEASE _ ID . eq ( INTER N SHIP _ RELEASE . INTER N SHIP _ RELEASE _ ID )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. where ( INTER N SHIP _ CHANGE _ HISTORY . INTER N SHIP _ RELEASE _ ID . eq ( intern ship Release Id ). and ( INTER N SHIP _ CHANGE _ HISTORY . ST UD ENT _ ID . eq ( student Id ))) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. orderBy < Timestamp >( INTER N SHIP _ CHANGE _ HISTORY . AP PLY _ TIME . desc ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. fetch () ĊĠĠĠ Ġ} Ċ }