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