나를 기록하다
article thumbnail
[백준 1485/자바(java)] 정사각형
Algorithm/baekjoon 2023. 8. 25. 11:23

https://www.acmicpc.net/problem/1485 1485번: 정사각형 첫째 줄에 테스트 케이스의 개수 T가 주어진다. 각 테스트 케이스는 네 줄로 이루어져 있으며, 점의 좌표가 한 줄에 하나씩 주어진다. 점의 좌표는 -100,000보다 크거나 같고, 100,000보다 작거나 같 www.acmicpc.net 문제 네 점이 주어졌을 때, 네 점을 이용해 정사각형을 만들 수 있는지 없는지를 구하는 프로그램을 작성하시오. 입력 첫째 줄에 테스트 케이스의 개수 T가 주어진다. 각 테스트 케이스는 네 줄로 이루어져 있으며, 점의 좌표가 한 줄에 하나씩 주어진다. 점의 좌표는 -100,000보다 크거나 같고, 100,000보다 작거나 같은 정수이다. 같은 점이 두 번 이상 주어지지 않는다. 출력 각..

article thumbnail
[Spring Boot] @NotEmpty 인식 불가(validation 관련)
Error/Spring Boot 2023. 7. 14. 13:57

에러 내용 1) 발생 → @NotEmpty 어노테이션이 인식되지 않는다. 2) 원인 Validation in Spring Boot | Baeldung 스프링 공식문서에서 부트2.3 부터는 validation 을 지원하지 않는다. 직접 ingection을 해줘야 한다. [Starting with Boot 2.3, we also need to explicitly add the spring-boot-starter-validation dependency:] 3) 해결 build.gradle 파일 dependency 부분에 아래 코드를 추가하면 사용 가능 implementation 'org.springframework.boot:spring-boot-starter-validation'

article thumbnail
[Spring Boot] @Test(expected ~) 에러 (Junit4, Junit5)
Error/Spring Boot 2023. 7. 13. 15:59

에러 내용 1) 발생 package jpabook.jpashop.service; import jpabook.jpashop.domain.Member; import jpabook.jpashop.repository.MemberRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.junit.jupiter.api.Test; import org.springframework.test.annotation.Rollback; import org.springframework.transaction.annotation.T..

article thumbnail
[Spring Boot] initializationError 해결(@RunWith 관련)
Error/Spring Boot 2023. 7. 11. 21:42

@RunWith(SpringRunner.class) 매핑 시 initializationError 발생 1) 발생 package jpabook.jpashop; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import org.spring..

article thumbnail
[Spring Boot] assertThat 호출 오류 해결
Error/Spring Boot 2023. 7. 11. 21:38

1. assertThat 호출 오류(import 구문 문제) 1) 발생 위와 같이 Assertions을 임포트하였으나 assertThat에 빨간줄이 그이는 것을 확인할 수 있다. 2) 원인 이유를 찾기 위해 서핑 결과, Intellij에서 자동으로 import 해주는 구문의 문제라는 것을 알 수 있었다. 3) 해결 [intelliJ] assertThat import 안되는 오류 [intelliJ] assertThat import 안되는 오류 문제 발생 assertThat을 사용하기 위해 AssertJ를 import를 하려고 했는데 import가 안되는 문제가 발생했다. 해결 방법 import static org.junit.Assert.*; 테스트를 생성할 때 자동으로 들어가는 import문을 지워주 sh..

article thumbnail
[TIL-10 / 230628] JPA 값 타입(임베디드 타입, 값 타입 컬렉션)
TIL 2023. 6. 28. 23:24

1. 기본값 타입 1) JPA의 데이터 타입 분류 엔티티 타입 @Entity로 정의하는 객체 데이터가 변해도 식별자로 지속해서 추적 가능 예) 회원 엔티티의 키나 나이 값을 변경해도 식별자로 인식 가능 값 타입 int, Integer, String처럼 단순히 값으로 사용하는 자바 기본 타입이나 객체 식별자가 없고 값만 있으므로 변경시 추적 불가 예) 숫자 100을 200으로 변경하면 완전히 다른 값으로 대체 2) 값 타입 분류 기본값 타입 자바 기본 타입(int, double) 래퍼 클래스(Integer, Long) String 예) String name, int age 생명주기를 엔티티에 의존 회원을 삭제하면 이름, 나이 필드도 함께 삭제 값 타입은 공유하면 안된다. 회원 이름 변경시 다른 회원의 이름..

profile on loading

Loading...