DataJPA/src/main/kotlin/com/chantha/jdbc/jpa/repo/CustomerRepo.java
2020-05-17 12:25:24 +07:00

12 lines
423 B
Java

package com.chantha.jdbc.jpa.repo;
import com.chantha.jdbc.jpa.model.Customer;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
public interface CustomerRepo extends CrudRepository<Customer,Long> {
@Query(value ="SELECT * FROM tb_customer c INNER JOIN tb_order o ON (c.id=o.cus_id)",nativeQuery = true)
@Override
Iterable<Customer> findAll();
}