모든 메소드의 호출 시간을 측정하고 싶다면? 공통 관심 사항(Cross-Cutting Concern) vs 핵심 관심 사항(Core Concern) public Long join(Member member){ long start = System.currentTimeMillis(); try{ // 같은 이름이 있는 중복 회원은 안된다. validateDuplicateMember(member); memberRepository.save(member); return member.getId(); } finally{ long finish = System.currentTimeMillis(); long timeMs = finish - start; System.out.println("join = " + timeMs + "..
JPA (JAVA Persistence API) • 자바 어플리케이션에서 관계형 데이터베이스를 사용하는 방식을 정의한 인터페이스 • 기존의 반복 코드는 물론 , 기본적인 SQL도 JPA가 직접 만들어서 실행해준다. • JPA 인터페이스 write-read.tistory.com 스프링 부트와 JPA만 사용해도 개발 생산성이 정말 많이 증가하고 , 개발해야할 코드도 확연히 줄어든다. 여기에 Spring Data JPA를 사용하면 , 기존의 한계를 넘어 마치 마법처럼 , 리포지토리에 구현 클래스 없이 인터페이스만으로 개발을 완료할 수 있다. 그리고 반복 개발해온 기본 CRUD 기능도 Spring Data JPA가 모두 제공한다. 따라서 개발자는 핵심 비즈니스 로직을 개발하는데 집중할 수 있다. 실무에서 관계형..
JPA (JAVA Persistence API) • 자바 어플리케이션에서 관계형 데이터베이스를 사용하는 방식을 정의한 인터페이스 • 기존의 반복 코드는 물론 , 기본적인 SQL도 JPA가 직접 만들어서 실행해준다. • JPA 인터페이스 write-read.tistory.com build.grlade 수정 dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' //implementation 'org.springframework.boot:spring-boot-starter-jdbc' imple..
순수 Jdbc와 동일한 환경설정을 하면 된다. 스프링 DB접근 기술 - 순수JDBC 순수 JDBC (주의! 이렇게 JDBC API로 직접 코딩하는 것은 20년 전 이야기이다. 참고만 하고 넘어가자) build.gradle 라이브러리 추가 dependencies { implementation 'org.springframework.boot:spring-boot-start.. write-read.tistory.com 스프링 JdbcTemplate과 MyBatis같은 라이브러리는 JDBC API에서 본 반복 코드를 대부분 제거해준다. 하지만 SQL은 직접 작성해야한다 JdbcTemplateMemberRepository package hello.hellospring.repository; import hello.h..
스프링 컨테이너와 DB까지 연결한 통합 테스트를 진행 MemberServiceIntegrationTest package hello.hellospring.service; import hello.hellospring.domain.Member; import hello.hellospring.repository.MemberRepository; import hello.hellospring.repository.MemoryMemberRepository; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api...
순수 JDBC (주의! 이렇게 JDBC API로 직접 코딩하는 것은 20년 전 이야기이다. 참고만 하고 넘어가자) build.gradle 라이브러리 추가 dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-jdbc' runtimeOnly 'com.h2database:h2' testImplementation 'org.springframework.boot:spring-boot-sta..
MemberController package hello.hellospring.controller; import hello.hellospring.domain.Member; import hello.hellospring.service.MemberService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation..
회원관리 예제 - Repository개발 및 테스트 케이스 작성 데이터 : 회원 ID, 이름 기능 : 회원 등록 , 조회 MemberRepository.java (Interface) package hello.hellospring.repository; import hello.hellospring.domain.Member; import java.util.List; import java.uti.. write-read.tistory.com 회원관리 예제 - Service개발 및 테스트 케이스 작성 회원관리 예제 - Repository개발 및 테스트 케이스 작성 데이터 : 회원 ID, 이름 기능 : 회원 등록 , 조회 MemberRepository.java (Interface) package hello.hello..
회원관리 예제 - Repository개발 및 테스트 케이스 작성 데이터 : 회원 ID, 이름 기능 : 회원 등록 , 조회 MemberRepository.java (Interface) package hello.hellospring.repository; import hello.hellospring.domain.Member; import java.util.List; import java.uti.. write-read.tistory.com Service package hello.hellospring.service; import hello.hellospring.domain.Member; import hello.hellospring.repository.MemberRepository; import hello.hell..
데이터 : 회원 ID, 이름 기능 : 회원 등록 , 조회 MemberRepository.java (Interface) package hello.hellospring.repository; import hello.hellospring.domain.Member; import java.util.List; import java.util.Optional; public interface MemberRepository { Member save(Member member); Optional findById(Long id); Optional findByName(String name); List findAll(); } MemoryMemberRepository.java (Implementation) package hello.h..
- Total
- Today
- Yesterday
- Iterable
- H2 DB
- 프로토타입 빈
- 싱글톤 빈
- 기본 메서드
- 준영속 엔티티
- 스프링부트
- annotation container
- Functional Interface
- 람다 표현식
- stream
- 빈 생명주기
- 스프링 빈 등록
- function패키지
- completablefuture
- 클라이언트 서버 구조
- 스태틱 메서드
- java8
- 생성자 주입
- HTTP 메시지
- JPA
- 티스토리 Open API
- 의존관계 주입
- 싱글 톤
- 기본 제공 함수형 인터페이스
- 싱글 톤 빈
- @configuration
- 메서드 레퍼런스
- 함수형 인터페이스
- 변경감지
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |