Created
May 8, 2018 20:02
-
-
Save aronbalog/7d02ff80f022d89a2ff5213697eee391 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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