분류 전체보기 31

6회차 - 미션

문제 6회차 미션 ✅ 예제, 연습문제 구현하기 jscode.notion.site 주안점 Optional Type 의 사용 JpaRepository 사용 일단 DTO 와 Entity 를 구분하지 않고 Entity 로 사용 어려웠던 점 Entity 에 @Getter 를 붙이지 않아, Postman 에 빈 괄호만 출력되어서 utf 설정 등 많이 헤맸음. 더보기 @Table @Entity @Getter // 반드시 붙이기 public class ProductEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column private String name; @Column private Long price; publi..

카테고리 없음 2023.03.26

5회차 - 미션

문제 5회차 미션 ✅ 데이터베이스 면접 단골질문 jscode.notion.site 데이터베이스 면접 단골질문 데이터베이스의 특징에 대해 설명하라. 데이터베이스란? 어느 한 조직의 여러 응용 시스템이 공유할 수 있도록 통합. 저장된 운영 데이터의 집합을 의미한다. 특징 1. 실시간 접근성(Real-Time Accessibility): 실시간 처리에 의한 응답이 가능해야 한다. 2. 계속적인 변화(Continuous Evolution): 새로운 데이터의 삽입(Insert), 삭제(Delete), 갱신(Update)로 항상 최신의 데이터를 유지한다. 3. 동시 공용(Concurrent Sharing): 다수의 사용자가 동시에 같은 내용의 데이터를 이용할 수 있어야 한다. 4. 내용에 의한 참조(Content ..

[Spring Boot] Cannot resolve class or package 'mysql' - MySQL 의존성 추가 에러 해결

에러 메시지 Cannot resolve class or package 'mysql' 문제발생 빌드는 잘 되는데, mysql 을 읽어오지 못함 원인 및 해결책 build.gradle 에 의존성을 잘 추가하였으나, 해당 라이브러리들이 로드되지 않음 File > Invalidate Caches 선택 후 IntelliJ 재시작 결과 참고 [SpringBoot] IntelliJ IDEA :: Cannot resolve class or package 'mysql' 에러 내용 Gradle 프로젝트에 mysql을 연동하려고 'spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver' 를 입력하였는데 발생 IntelliJ IDEA 에서 Gradle 기반의 프로젝트 작성..

에러일기 2023.03.23

[Spring Boot] Could not find mysql:mysql-connector-java:. - MySQL 의존성 추가 에러 해결

에러 메시지 Execution failed for task ':compileJava'. > Could not resolve all files for configuration ':compileClasspath'. > Could not find mysql:mysql-connector-java:. Required by: project : Possible solution: - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html 문제발생 빌드에러 원인 및 해결책 mysql-connector 버전을 명시하지 않음 depen..

에러일기 2023.03.23

Spring Data JPA 세팅하기

127.0.0.1 connection 연결하기 로컬 connection 을 추가하면 자동으로 만들어진 sys 스키마의 sys_config 테이블 확인가능 Spring Data JPA 프로젝트 생성 후 Spring Boot 프로젝트 생성하기 Spring Initializr https://start.spring.io [Spring Boot] spring initializr 사용하기 spring initializr spring boot 기반으로 spring 관련 프로젝트를 생성해주는 사이트로 project를 다운로드 하여 쉽게 사용 가능하다. https:// ygeum2.tistory.com build.gradle 에서 의존성 추가 dependencies { // MySQL implementation 'mys..

Spring 2023.03.23

4회차 - 미션 (2)

문제 상품 이름으로 상세 조회하는 api 4회차 미션 오늘 미션은 스프링을 처음 하시는 분들한테는 매우 어려울 수 있어요. 미션 보다는 오늘 수업에 대한 이해와 연습문제 풀이를 중점으로 진행해주시고, 그 내용만 정리해서 올려주셔도 됩니다. jscode.notion.site 주안점 monetaryUnit 을 통해 가격을 다르게 조회하기 없는 상품명으로 조회 시, 조회 실패 어려웠던 점 조회 실패 시 String 타입의 메시지를 리턴할 때 Product5 와 String 의 충돌로 에러를 해결하지 못함 더보기 @Repository public class ProductRepository5 { private final List products = List.of( new Product5("키보드", 10000L)..

4회차 - 미션 (1)

문제 상품 등록 api 만들기 4회차 미션 오늘 미션은 스프링을 처음 하시는 분들한테는 매우 어려울 수 있어요. 미션 보다는 오늘 수업에 대한 이해와 연습문제 풀이를 중점으로 진행해주시고, 그 내용만 정리해서 올려주셔도 됩니다. jscode.notion.site 주안점 Post method 와 RequestBody 의 활용 어려웠던 점 RequestBody 로 두 개 이상의 input 을 받기 어려웠음. 이미 동일한 이름의 상품으로 등록을 요청할 경우, 중복 검사를 Service 와 Repository 중 어디서 할 지 모르겠음. 주요 연습내용 RequestBody 로 두 개 이상의 input 을 받기 위해 CreateProductReq 를 만들어서 사용함 더보기 @PostMapping("") publi..

4회차 - 연습문제 (3)

문제 상품 조회 api 역할 구분하기 controller, service, repository 구분하기 학습목표 - controller, service, repository가 각각 어떤 역할을 하는지 이해한다. - 하나의 api를 구현할 때 controller, service, repository로 계층을 나눠서 구현할 수 있다. jscode.notion.site 풀이 @RestController @RequestMapping("api/products") public class ProductController3 { private final ProductService3 productService; public ProductController3(ProductService3 productService) { th..

4회차 - 연습문제 (2)

문제 상품 등록 api 역할 구분하기 controller, service, repository 구분하기 학습목표 - controller, service, repository가 각각 어떤 역할을 하는지 이해한다. - 하나의 api를 구현할 때 controller, service, repository로 계층을 나눠서 구현할 수 있다. jscode.notion.site 풀이 @RestController @RequestMapping("api/products") public class ProductController2 { private final ProductService2 productService; public ProductController2(ProductService2 productService) { th..

4회차 - 연습문제 (1)

문제 상품 조회 api Controller, Service, Repository 구분해서 구현하기 controller, service, repository 구분하기 학습목표 - controller, service, repository가 각각 어떤 역할을 하는지 이해한다. - 하나의 api를 구현할 때 controller, service, repository로 계층을 나눠서 구현할 수 있다. jscode.notion.site 풀이 package com.jscode.spring.day04.Example1; import java.util.List; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.b..