
Spring, Java 에 관해서 알게된 것들 1 Interface와 Abstract Method 의 차이, final과 static final의 차이 velog.io 위 블로그에 상세하게 차이점이 나와있다! 결론은 추상 클래스는 1개만 상속 가능 인터페이스는 다중 상속 가능 추상 클래스는 대표적인/공통적인 것을 표현할 때 사용, 인터페이스는 구성하는 요소들이 자주 바뀔 때 사용 1) 모듈 : 클래스, 패키지, 라이브러리와 같이 프로그램을 구성하는 임의의 요소 기능별로 나눠진 것을 모듈이라고 하며, 이렇게 소프트웨어를 각 기능(모듈)로 나누는 것을 모듈화 2) 자바 언어에서의 모듈 : 여러 클래스들의 모음 -> 패키지 -> 여러 패키지들의 모음 -> 모듈 (자바 : 모듈 > 패키지 > 클래스) 3) 기타..
https://doing7.tistory.com/79 Domain, Entity, Value(Object) Spring 프로젝트 중에 Domain, Entity, VO(value object)라는 용어들이 반복적으로 등장하지만, 정작 이들의 차이를 모르고 있다는 생각이들었다. 이에 관련되어 더 공부하고자 DDD START 도메인 주도 설계(최 doing7.tistory.com 위 블로그에 아주 상세하게 잘 설명되어 있다. 한 마디로 소프트웨어로 해결하고자 하는 "문제 영역" (여러가지가 존재)
package com.example.sparta_3.domain; import org.springframework.data.jpa.repository.JpaRepository; import java.time.LocalDateTime; import java.util.List; //쿼리 메소드 리턴 타입은 Page, Slice, List 와 같은 Collection 형태 // 엔티티에서 ()에 해당하는 값을 조회해서 List 컬렉션 타입으로 리턴 public interface MemoRepository extends JpaRepository { //JpaRepository 상속, Memo라는 녀석의 id가 Long인 녀석 //수정 전 // List findAllByOrderByModifiedAtDesc();..

Query Method 사용하려는 Repository에 JpaRepository만 상속해주면 스프링의 AOP 기능을 사용하여 구현까지 자동으로 해준다. 간단한 문법으로 객체의 CRUD가 가능하다. 기본적으로 find + "객체" + By + "변수" 로 사용하는데. 중간에 객체는 생략 가능하다. List findByItemNm(String itemNm) -> itemNm 변수명을 사용해서 해당하는 모든 객체를 가져온다. List findByPriceLessThan(Integer price) -> price 변수보다 높은 객체들을 모두 가져온다. 출처 : https://velog.io/@simgyuhwan/%EC%BF%BC%EB%A6%AC-%EB%A9%94%EC%86%8C%EB%93%9C-JPQL-Quer..

application.properties에 spring.h2.console.enabled=true spring.datasource.url=jdbc:h2:mem:testdb 이렇게 설정하고, http://localhost:8080/h2-console 접속 첫 번째 발생한 오류 C:/Users/사용자명/test" not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-200] 90149/90149 해결법) 로그인 화면의 jdbc url에 아래의 값 jdbc:h2:뒤에 Database not found라고 나온 경로를 넣어주고 연결 버튼을 누른다. jdbc:h2:..

https://developers.naver.com/docs/serviceapi/search/local/local.md#%EC%A7%80%EC%97%AD 지역 - Search API 지역 NAVER Developers - 검색 API 지역 검색 개발가이드 검색 > 지역 네이버 지역 서비스에 등록된 각 지역별 업체 및 상호 검색 결과를 출력해주는 REST API입니다. 비로그인 오픈 API이므로 GET으로 호출 developers.naver.com https://developers.naver.com/apps/#/myapps/TNYycpp5NSwKwDC0xjpg/overview 애플리케이션 - NAVER Developers developers.naver.com 클라이언트 ID와 Client Secret을 할..

클라이언트에서 헤더를 넣어서 보내보자 package com.example.client.service; import com.example.client.dto.UserRequest; import com.example.client.dto.UserResponse; import org.apache.catalina.User; import org.springframework.http.MediaType; import org.springframework.http.RequestEntity; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.web.clien..

client의 RestTemplateService.java post 부분 넣기 package com.example.client.service; import com.example.client.dto.UserRequest; import com.example.client.dto.UserResponse; import org.apache.catalina.User; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBu..