Skip to content

Instantly share code, notes, and snippets.

@aronbalog
Created May 8, 2018 20:02
Show Gist options
  • Save aronbalog/7d02ff80f022d89a2ff5213697eee391 to your computer and use it in GitHub Desktop.
Save aronbalog/7d02ff80f022d89a2ff5213697eee391 to your computer and use it in GitHub Desktop.
package com.example.demo.dao
import com.example.demo.repository.PersonRepository
import org.springframework.stereotype.Component
@Component
class PersonDao(
private val personRepository: PersonRepository
) {
fun getPersonById(id: String) =
personRepository.findById(id)
fun getPersonsByName(name: String) =
personRepository.findByNameLike(name)
fun createPerson(name: String) =
personRepository.save(Person(name = name))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment