목록분류 전체보기 (34)
끄적끄적
특징 @Async를 적용하는 메소드는 반드시 public 메소드여야함 같은 클래스의 메소드가 호출시 동작하지 않음(프록시 관련 문제) @Async를 적용하는 메소드의 return 타입 => Future 또는 void 사용법 @Configuration @EnableAsync public class AsyncConfig { @Bean(name = "threadPoolTaskExecutor") public Executor threadPoolTaskExecutor() { return new ThreadPoolTaskExecutor(); } } @Async("threadPoolTaskExecutor") public void asyncMethodWithConfiguredExecutor() { System.out.p..
- ExceptionHandlerAdvice 생성 @RestControllerAdvice public class ExceptionHandlerAdvice extends ResponseEntityExceptionHandler { @Override protected ResponseEntity handleExceptionInternal(Exception ex, Object body, HttpHeaders headers, HttpStatus status, WebRequest request) { return super.handleExceptionInternal(ex, body, headers, status, request); } @Override protected ResponseEntity handleMethod..
###JPA spring.jpa.generate-ddl=false spring.jpa.show-sql=true spring.jpa.database=mysql 상세 내용 추가 예정
MySQL 기준입니다. # MySQL Configuration spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/DB이름?useSSL=false&characterEncoding=UTF-8&serverTimezone=Asia/Seoul spring.datasource.username=root spring.datasource.password=1234 @SpringBootTest class DatabaseTests { @Value("${spring.datasource.driver-class-name}") private String DRIVER; @Value("${..
@SpringBootApplication @PropertySources({ @PropertySource("classpath:properties/private/database-config.properties"), @PropertySource("classpath:properties/private/mail-config.properties"), @PropertySource("classpath:properties/private/jwt-config.properties"), @PropertySource("classpath:properties/pagination-config.properties"), @PropertySource("classpath:properties/file-upload-config.properties..
(계속 추가 중) - DDL CREATE DATABASE DB이름 default CHARACTER SET UTF8; - DML

- liveReload&devtools 설치 1. 크롬 확장프로그램에서 liveReload 설치 2. dependency , properties 설정 추가 org.springframework.boot spring-boot-devtools runtime true ## devtools & liveReload spring.devtools.livereload.enabled=true spring.freemarker.cache=false 3. ctr + shift + a 이후 registry 검색 후 설정 4. ctr + alt + s 이후 compiler 검색 후 설정 * 만약 적용이 안된다면 브라우저의 캐시를 삭제 - lombok 1. dependency 추가 org.projectlombok lombok tru..