Spring Boot 3

Spring Boot으로 웹 출시까지 #8. JPA를 이용한 페이지 처리 및 검색

bootstrap를 이용해서 page-overview를 확인하는 ui를 변경해주자. JPA를 이용해서 페이지를 가져오는 작업을 PagingAndSortingRepositorty interface를 검색해서 참고한다. BoardController을 아래와 같이 해준다. @GetMapping("/list") public String list(Model model) { Page boards = boardRepository.findAll(PageRequest.of(1, 20)); model.addAttribute("boards", boards); return "board/list"; } pageable도 이용해서 코드를 작성해주자. @GetMapping("/list") public String list(Mod..

Spring/SpringBoot 2022.06.02

Spring Boot으로 웹 출시까지 #7. JPA이용한 RESTful API 작성

참고 사이트에서 REST 서비스를 Spring을 이용해서 다뤄보자. JPA를 이용해서 mariaDB의 데이터 조작할 수 있는 컨트롤러 생성 PostMan을 이용해서 http요청을 통해 CRUD 데이터 조작하기 참고 사이트 아래의 HTTP is the Platform을 사용해보자. package payroll; import java.util.List; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springfr..

Spring/SpringBoot 2022.06.02

JPA와 DB 설정, 동작확인 - 테스트 실행 오류

아래 Test Code를 실행하려고 하니까 에러발생 해결중 // MemberRepositoryTest package jpabook.jpashop; import org.assertj.core.api.Assertions; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.jun..

Spring/SpringBoot 2022.03.29