본문 바로가기

Programming!

Spring Cache Error 오늘의 삽질. 첫번째: spring-data-jpa에서 인터페이스 기반의 projection을 반환 받아 redis cache에 담으면 에러가 난다. (리포팅되어 있는 듯.) "java.io.NotSerializableException: org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor" ... 두번째: @JsonView가 지정된 Dto를 캐시에 담은 후 Controller에서 재조회시 @JsonView의 속성이 지정되지 않는다. 즉, Controller를 거쳐 출력되는 것은 옵션에 따라 다르지만 empty 이거나 Dto 전체 속성이거나 일것이다.(전체 속성이여도 값은 null) 좀 더 해봐야 겠지만 거참... 더보기
Bean Mapper/Transformer Mapper/Transformer bull-bean-transformer : https://github.com/HotelsDotCom/bull HotelsDotCom/bull BULL - Bean Utils Library. Contribute to HotelsDotCom/bull development by creating an account on GitHub. github.com Mapstruct : https://mapstruct.org/ MapStruct – Java bean mappings, the easy way! Java bean mappings, the easy way! Get started Download mapstruct.org Orika : https://github.com/orika-m.. 더보기
QueryDSL Predicate Builder 추가 조건관련 작업시 아래처럼 엔티티별 별도의 Predicate를 사용하기는 하는데 가끔 보기 싫을 때가 있다. 기존에는 아래처럼 조건을 별도로 구분해서 나눈 후, allOf로 조합처리 했는데. public static Predicate containsBrandName(BrandFindCondition condition) { BooleanBuilder builder = new BooleanBuilder(); if (!StringUtils.isEmpty(condition.getBrandName())) { builder.and(qBrandEntity.brandName.contains(condition.getBrandName())); } return builder; } public static Predicate c.. 더보기
사용을 잘 안해서... IntelliJ에서 cmd+shift+a 를 누를때 갑자기 command 터미널이 열리고 man 이 실행된다. 엌... 흠.. 뭐지..싶다가 대충 찾아보니 Mac OS 단축키가 등록되어 있다고.. 해제시키고 문제 없음을 확인. ㅎㅎㅎㅎ 더보기
IntelliJ 에서 JUnit 5 실행 실패. Error : No tests found for given includes 두가지 처리 방법. 1. IntelliJ에 테스트 실행 변경. - Run tests using을 Gradle에서 IntelliJ IDEA로 변경 후 실행한다. 2. build.gradle 파일내 플랫폼 지정. test { .... outputs.dir snippetsDir useJUnitPlatform() } 어짜피 혼자 개발 하는 것은 아니니... 2번 방법을 추천. (Gradle로 플젝 생성시 기본적으로 useJUnitPlatform() 이 등록되어 있는데 왜 빠져있던거지..) 더보기