Sample Code import org.springframework.context.annotation.Import; import java.lang.annotation.*; @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited @Import({ PracticeConfigRegistrar.class }) public @interface EnablePracticeConfigAnnotation { Class[] basePackageClasses(); } 1. @Enable 어노테이션을 만들어서 Conifguration에 Registrar를 등록한다. import org.springframework.beans.fa..
특정 범위에 포함된 모든 Controller에서 발생하는 Exception을 전역처리할 때 ControllerAdvice를 사용한다. import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframe..
1. JSR-303 JSR- 303는 자바플랫폼의 유효성 검사 제약사항 선언과 메타데이터를 표준화한다. JSR-303 API를 사용해서 선언적인 유효성 제약사항으로 도에인 모델 프로퍼티에 어노테이션을 붙히고 런타임시에 이를 강제할 수 있다. 사용할 만한 다수의 내장 제약사항이 존재한다. 물론 자신만의 커스텀 제약사항도 정의할 수 있다. 2. JSR-303 Specification 검증은 Field 및 Collection에 사용할 수 있다. Annotation Specification @NotNull validates that the annotated property value is not null @AssertTrue validates that the annotated property value is t..

1. create aop class import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.springframework.stereotype.Component; @Slf4j @Aspect @Component public class SomeAop { @Around("execution(* com.project.kanban.web.SomeController.*(..))") public Object aroundLogging(ProceedingJoinPoint..
1. create request proxy class import lombok.Getter; import lombok.ToString; import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.ScopedProxyMode; import org.springframework.stereotype.Component; @Getter @ToString @Component @Scope(value = "request", proxyMode = ScopedProxyMode.TARGET_CLASS) public class SomeRequestProxy { private String preString; pr..
1. create some argument resolver class import org.springframework.core.MethodParameter; import org.springframework.mobile.device.Device; import org.springframework.mobile.device.DeviceResolver; import org.springframework.mobile.device.LiteDeviceResolver; import org.springframework.web.bind.support.WebDataBinderFactory; import org.springframework.web.context.request.NativeWebRequest; import org.s..
1. create some interceptor class import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.WebContentInterceptor; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @Slf4j public class SomeInterceptor extends WebContentIn..
LocalDateTime의 Format1. DateTimeFormatter.ISO_DATE_TIME- 2018-10-10T00:00:00.000+09:00- 2018-10-10T00:00:00.000Z 2. 그밖의 format- yyyyMMddHHmmss- yyyy-MM-dd HH:mm:ss- yyyy-MM-dd LocalDateTime의 다양한 변환1. LocalDateTime sql.TimeStampimport java.sql.Timestamp; @Converter(autoApply = true)public class LocalDateTimeConverter implements AttributeConverter { @Override public Timestamp convertToDatabaseColu..
1. Dependenciescompile "org.springframework:spring-orm:4.3.11.RELEASE"compile "org.springframework.data:spring-data-jpa:1.11.7.RELEASE"compile "org.hibernate:hibernate-core:5.2.11.Final"compile "org.hibernate:hibernate-entitymanager:5.2.11.Final"compile "com.querydsl:querydsl-jpa:4.1.3"2. Plugin settingMaven //QueryDSL com.mysema.maven apt-maven-plugin 1.1.3 process target/generated-sources/java..
AsyncEventBus // AsyncEventBus Configuration import com.google.common.eventbus.AsyncEventBus; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.Executor; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; private static final int CORE_POOL_SIZE = 80; private static final int MAX_POOL_SIZE = 100; private static final int KEEP_ALIVE_TIME..
- Total
- Today
- Yesterday
- SmartLifecycle
- @Primary
- guava
- DI
- Criteria
- Akka
- docker
- Sprint RetryTemplate
- scikit-learn
- Embedded Mapping
- java EqualsAndHashCode
- Typesafe Config
- Spring
- Spring Registrar
- java generic
- JPA Criteria
- Registrar
- Join Table
- Property
- Embeddable Mapping
- Query DSL
- Discriminate Mapping
- Spring JDBC Template
- Mapping
- 복합키 Mapping
- JPA
- Charles proxy
- java Equals
- RetryTemplate
- spring spel
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |