18 lines
703 B
Kotlin
18 lines
703 B
Kotlin
package com.chantha.mini.repo
|
|
|
|
import com.chantha.mini.dto.UserDto
|
|
import org.springframework.stereotype.Repository
|
|
import org.springframework.data.jpa.repository.JpaRepository
|
|
import org.springframework.data.jpa.repository.Query
|
|
import java.util.*
|
|
|
|
@Repository
|
|
interface UserRepo : JpaRepository<UserDto,Long> {
|
|
|
|
@Query("SELECT * FROM user_dto WHERE firstName=?1 AND lastName=?2",nativeQuery = true)
|
|
fun findByFirstnameAndLastname(firstName:String?="",lastName:String?=""):UserDto
|
|
@Query("SELECT * FROM user_dto",nativeQuery = true)
|
|
fun findAllRecord():List<UserDto>
|
|
@Query("SELECT * FROM user_dto WHERE id=?1",nativeQuery = true)
|
|
fun findByOneRecord(Id :Long ): List<UserDto>
|
|
} |