2020-05-16 17:20:48 +07:00
|
|
|
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>
|
2020-05-17 13:35:32 +07:00
|
|
|
|
|
|
|
@Query("SELECT * FROM product",nativeQuery = true)
|
|
|
|
fun readAllRecord():List<Product>
|
|
|
|
|
2020-05-16 17:20:48 +07:00
|
|
|
}
|