2023-04-24-TIL
2023-04-24-TIL
Today I Learned
Builder Pattern for Java Records
- https://howtodoinjava.com/java/basics/builder-pattern-for-java-records/
- https://www.baeldung.com/java-record-vs-lombok
Jackson2ObjectMapperBuilderCustomizer vs MessageConverter
JSON 응답은 전역적으로 Jackson2ObjectMapperBuilderCustomizer를 통해서 LocalDateTime으로 변환되도록 직렬화 설정을 했다.
1
2
3
4
5
6
7
8
9
10
11
12
@Configuration
public class JsonConfig {
private static final String dateTimeFormat = "yyyy-MM-dd HH:mm:ss";
@Bean
public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
return builder -> {
builder.serializers(new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(dateTimeFormat)));
};
}
}
하지만 JSON 요청에 대해서는 이 설정이 동작하지 않았다.
최신버전의 스프링에서는 application.properties 설정 하나로 이를 관리할 수 있게 지원해준다.
1
2
3
4
spring:
mvc:
format:
date-time: yyyy-MM-dd HH:mm:ss
- https://shanepark.tistory.com/364
Jackson and ObjectMapper
- https://circlee7.medium.com/spring-boot-jackson-json-xss-%EC%B2%98%EB%A6%AC-fdc85a18e9f2
- https://www.baeldung.com/spring-boot-customize-jackson-objectmapper
- https://interconnection.tistory.com/137
- https://www.baeldung.com/spring-boot-customize-jackson-objectmapper
- https://github.com/eugenp/tutorials/tree/master/spring-boot-modules/spring-boot-data-2
- https://recordsoflife.tistory.com/599
Pagination in QueryDSL
- https://jessyt.tistory.com/55
- https://data-make.tistory.com/671
- https://wildeveloperetrain.tistory.com/135
- https://velog.io/@recordsbeat/QueryDSL%EB%A1%9C-%EA%B2%80%EC%83%89-%ED%8E%98%EC%9D%B4%EC%A7%95-%EC%A0%81%EC%9A%A9%ED%95%98%EA%B8%B0
- https://vladmihalcea.com/pagination-best-practices/
- https://jddng.tistory.com/345
- https://samuel-mumo.medium.com/dynamic-queries-and-querydsl-jpa-support-in-spring-a1b4e233084b
QueryDSL Proejction
- https://cheese10yun.github.io/querydsl-projections/
Dynamic Query with QueryDSL
- https://rieckpil.de/howto-dynamic-sql-querying-pagination-with-querydsl-and-spring-data-jpa/
This post is licensed under CC BY 4.0 by the author.