Skip to content

Instantly share code, notes, and snippets.

@Tonel
Created July 26, 2020 13:54
Show Gist options
  • Select an option

  • Save Tonel/9219ce47e8dace0b5a23608d41350940 to your computer and use it in GitHub Desktop.

Select an option

Save Tonel/9219ce47e8dace0b5a23608d41350940 to your computer and use it in GitHub Desktop.
@Service
class AuthorService : CustomService() {
fun getByKey(key : Int) : Author {
return authorDao.findByKey(key).get()
}
fun getByName(name : String) : List<Author> {
return authorDao.findByName(name)
}
fun getAll() : List<Author> {
return authorDao.findAll()
}
}
@Transactional(readOnly = true)
abstract class CustomService {
@Autowired
protected lateinit var authorDao: AuthorDao
@Autowired
protected lateinit var bookDao: BookDao
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment