반응형 Spring20 API 문서 자동화 - Spring REST Docs Document RESTful services by combining hand-written documentation with auto-generated snippets produced with Spring MVC Test. The aim of Spring REST Docs is to help you produce accurate and readable documentation for your RESTful services. 출처: https://docs.spring.io/spring-restdocs/docs/current/reference/html5/ 위 글은 Spring REST Docs의 공식 문서에 있는 글입니다. Spring REST Docs를 사용하면 저희가 만든 API에 읽기 쉬운 문서를 자.. 2021. 11. 27. Spring Data JPA - Save Method 동작 방식 Spring Data JPA에서 제공하는 JpaRepository.save(T); [T는 Entity]의 내부 동작 방식에 대해서 정리하려고 합니다. JPA에서의 save 메서드 구현체 코드는 다음과 같습니다. // SimpleJpaRepository.java [JPA 구현체] @Transactional @Override public S save(S entity) { Assert.notNull(entity, "Entity must not be null."); if (entityInformation.isNew(entity)) { // 1 em.persist(entity); // 2 return entity; // 3 } else { // 4 return em.merge(entity); // 5 } } JP.. 2021. 11. 26. 이전 1 2 3 4 다음 반응형