본문 바로가기

분류 전체보기363

[LeetCode] AddTwoNumbers 문제 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. Example: Input:* (2 -> 4 -> 3) + (5 -> 6 -> 4) Output:* 7 -> 0 -> 8 Explanation:* 3.. 2020. 7. 11.
git commit 된 것 삭제시키는 방법 이전 commit A 으로 되돌리고, A 이후의 commit 들은 전부 삭제하는 법. 아래와 같이 하면 A 이후의 커밋은 전부 삭제 됨. 이 때 A 는 commit ID 를 의미 함. git reset --hard [A] git push --force 2020. 7. 11.
spring-boot, Jpa 정리 - Transaction 묶음 시행 착오 Spring, Spring Boot 의 시작점을 통해 시작하지 않는다면, @Transactional 어노테이션이 안먹는거 같음. 이를 통해 트랜잭션 매니저가 제대로 설정 안되면 위 @Transactional 이 적용안된 것을 알 수 있었음. 처음 내가 의도한 바는 repository interface 를 통해 @Transactional 로 묶는거였음. 근데 안묶임. WebService 만들 때는 잘 묶였는데 jpa 만 떼어다가 쓸려니 안먹힘. 추후 왜 @Transactional 이 안먹히는지 원인 파악 해보기. source EntityManager 생성은 spring-boot 의 AutoConfiguration 을 이용했고, EntityManagerFactory 를 가져와서 EntityMana.. 2020. 7. 11.
spring-boot, Jpa 정리 - Integrate test (Jpa 통합 테스트) 나중에 볼 용도로 정리한 것. Jpa 통합 테스트 세팅 방법 Jpa 단독 (repository) 으로 테스트 하고 싶다면, @DataJpaTest 를 사용 @DataJpaTest 를 사용한다면 단독으로 repository bean 초기화가 일어나고 사용할 수 있음. 여기서는 서비스 테스트를 위해 통합 테스트 하는 방법을 설명 source 간략히 설명하면 @SpringBootTest 를 수행하면 @SpringBoot 와 비슷한 과정을 겪게 됨. (Scan, Bean initialize 등) 아래와 같이 어노테이션을 설정해두면 빈 초기화가 일어나면서 repository, 서비스 등 빈 초기화가 일어 남. 단, 이 때, 주의할 점은 반드시 Bean 에 등록해야한다. 자바 new 로 생성해버리면 빈에 등록이 안.. 2020. 7. 11.