전체 글323 2021-08-23-EntityGraph layout : post title : "EntityGraph 사용하여 LazyLoading 데이터 가져오기" category : Spring @EntityGraph(attributePaths = {"a", "b"}, type = EntityGraph.EntityGraphType.LOAD) Page findById(Pageable pageable); 위와 같이 attributePaths 에 원하는 데이터를 설정하면 getA()로 데이터를 불러 올 수 있다. a와 b는 아래와 같이 도메인에서 사용하는 이름이다 class Temp { private A a; private B b; } 2023. 2. 28. 2021-07-27-Swagger layout : post title : "Swagger 적용" category : Spring @EnableOpenApi 추가 @EnableOpenApi @SpringBootApplication public class AlbaCheckerApplication { public static void main(String[] args) { SpringApplication.run(AlbaCheckerApplication.class, args); } } grade 추가 // https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui implementation 'io.springfox:springfox-swagger-ui:3.0.0' // https:.. 2023. 2. 28. 2021-06-30-Header-language layout : post title : "Request Header 언어 읽기" category : Spring customAxios.interceptors.request.use(function (req) { req.headers["Accept-Language"] = 'en'; return req; }); axios 공통 설정을 통해 정보를 넣어준다. @Component public class Message { private static MessageSource messageSource; public Message(MessageSource messageSource) { Message.messageSource = messageSource; } public static String getMessage(Str.. 2023. 2. 28. 2021-06-10-TimeZone-setting layout : post title : "Timezone 안맞는 문제" category : Spring Os - JVM - JPA - DB 위처럼 다양한 곳에서 timezone을 가지고 있어 엉키는 문제가 생겨 따로 설정이 필요하다. JPA의 시간이 설정 spring.jpa.properties.hibernate.jdbc.time_zone=UTC JVM의 시간이 설정 TimeZone.setDefault(TimeZone.getTimeZone("UTC")); JVM이 설정 java -jar -Duser.language= -Duser.country=KR -Duser.timezone=Asia/Seoul JPA의 경우 DB에 입력되는것 조정하고 JVM은 어플리케이션에 사용되는 시간이다. 2023. 2. 28. 이전 1 ··· 7 8 9 10 11 12 13 ··· 81 다음