Spring69 01-02-2024 Scheduler @Scheduled("{시간}") CronExpression https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/support/CronExpression.html CronExpression (Spring Framework 6.1.3 API) Determine whether the given string represents a valid cron expression. docs.spring.io @Scheduled(cron = "0 0 1 * * *") // 매일 새벽 1시 // ( 초 , 분 , 시 , 일 , 달 , 년 ) ////// (spring data JPA) P.. 2024. 2. 1. Spring 숙련 20 (My Select Shop 프로젝트 1) / 상품 검색 API 구현 및 확인 1. 프로젝트 생성 with JPA, Security, Thymeleaf , Validation , Web, Lombok dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springfr.. 2024. 1. 31. Spring 숙련 19 (고아 엔티티 지우기(Orphan)) () 대충 이런 상황 유저 테이블 음식 테이블 연관관계 제거 하는 @Transactional void test1() { // 고객 Robbie 를 조회합니다. User user = userRepository.findByName("Robbie"); System.out.println("user.getName() = " + user.getName()); // 연관된 음식 Entity 제거 : 후라이드 치킨 Food chicken = null; for (Food food : user.getFoodList()) { if(food.getName().equals("후라이드 치킨")) { chicken = food; } } if(chicken != null) { user.getFoodList().remove(chicken).. 2024. 1. 31. Spring 숙련 18 (지연 로딩) (영속성 전이) 음식 테이블과 고객 테이블이 N : 1 양방향 관계로 가정 해보겠습니다. . { // 난주엥 설명 saveAll : .deleteAl : ..... } ///// @Test @DisplayName("아보카도 피자 조회") void test1() { Food food = foodRepository.findById(2L).orElseThrow(NullPointerException::new); System.out.println("food.getName() = " + food.getName()); System.out.println("food.getPrice() = " + food.getPrice()); System.out.println("아보카도 피자를 주문한 회원 정보 조회"); System.out.print.. 2024. 1. 31. 이전 1 ··· 7 8 9 10 11 12 13 ··· 18 다음