3 changed files with 44 additions and 0 deletions
@ -0,0 +1,13 @@ |
|||
package bc.mm.mis.dao; |
|||
|
|||
import bc.mm.mis.bean.Country; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Repository |
|||
public interface CountryDao extends JpaRepository<Country,Integer> { |
|||
// find all
|
|||
List<Country> findAll(); |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
package bc.mm.mis.service; |
|||
|
|||
import bc.mm.mis.bean.Country; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Component |
|||
public interface CountryService { |
|||
List<Country> findAll(); |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
package bc.mm.mis.service.impl; |
|||
|
|||
import bc.mm.mis.bean.Country; |
|||
import bc.mm.mis.dao.CountryDao; |
|||
import bc.mm.mis.service.CountryService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Component |
|||
public class CountryServiceImpl implements CountryService { |
|||
@Autowired |
|||
CountryDao countryDao; |
|||
|
|||
@Override |
|||
public List<Country> findAll() { |
|||
return countryDao.findAll(); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue