package com.example.sample.service import com.example.sample.entity.BookDto import com.example.sample.entity.BookEntity import com.example.sample.mapper.SampleMapper import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional @Service class SampleService( private val sampleMapper: SampleMapper ) { @Transactional() fun execute() : BookDto { val book: BookEntity = sampleMapper.findBy(0) return BookDto(book.name ?: "", book.author ?: "") } }