13 lines
499 B
Kotlin
13 lines
499 B
Kotlin
package com.chantha.jdbc.jpa.repo
|
|
|
|
import com.chantha.jdbc.jpa.model.Product
|
|
import org.springframework.data.jpa.repository.Query
|
|
import org.springframework.data.repository.CrudRepository
|
|
import org.springframework.stereotype.Repository
|
|
|
|
@Repository
|
|
interface ProductRepo : CrudRepository<Product,Long>{
|
|
@Query("SELECT * FROM product INNER JOIN order_detail ON (product.product_id=order_detail.product_id)"
|
|
, nativeQuery = true)
|
|
override fun findAll(): MutableIterable<Product>
|
|
} |