일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 바운디드 타입
- 자바스터디
- 접근지시자
- 익명 클래스
- Switch Expressions
- System.out
- 프리미티브 타입
- annotation processor
- Effective JAVA
- auto.create.topics.enable
- 항해99
- 스파르타코딩클럽
- Java
- 로컬 클래스
- System.err
- github api
- 정렬
- 상속
- public 필드
- 제네릭 타입
- junit 5
- 함수형 인터페이스
- 자바할래
- 람다식
- raw 타입
- System.in
- 브릿지 메소드
- Study Halle
- 합병 정렬
- 제네릭 와일드 카드
- Today
- Total
목록분류 전체보기 (275)
코딩하는 털보
오늘의 삽질 순환 참조 에러 Is there an unresolvable circular reference? UserService가 MonsterService를 DI 받고 @Service @RequiredArgsConstructor public class UserService { private final UserRepository userRepository; private final FollowServiceImpl followService; private final MonsterService monsterService; private final HabitServiceImpl habitService; 반대로 MonsterService도 UserService를 DI 받는다면 @Service @Required..
Mysql Replication with Docker 필수 패키지 설치 sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common GPG Key 인증 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 도커 설치 sudo apt-get update && sudo apt-get install docker-ce docker-ce-cli containerd.io ubuntu 유저에 도커 권한 부여 sudo usermod -aG docker ubuntu Mysql 도커 이미지 다운로드 sudo docker ..
오늘의 삽질 Nginx SSL 설정하기 certbot 설치 sudo snap install certbot --classic 아래의 명령어로 인증서를 받을 수 있다. mydomainaddress에는 나의 도메인 이름, mymail@mail.com에는 이메일 주소를 넣는다. sudo certbot --nginx -d mydomainaddress --email mymail@mail.com --agree-tos 잘 완료되었다면 nginx.conf 파일의 해당 도메인에 맞는 server 에 알아서 내용을 추가해준다. server { include /etc/nginx/conf.d/service-url.inc; server_name rtonepage.shop localhost; listen 443 ssl; # man..
오늘의 삽질 Jasypt를 사용하여 application.properties 암호화 하기 Jasypt 라이브러리는 스프링 어플리케이션을 개발할 때 프로퍼티에 대한 암호화 기능을 제공한다. 참고 : https://github.com/ulisesbocchio/jasypt-spring-boot#use-you-own-custom-encryptor Simply add the starter jar dependency to your project if your Spring Boot application uses @SpringBootApplication or @EnableAutoConfiguration and encryptable properties will be enabled across the entire Spri..
오늘의 삽질 Junit으로 Filter 테스트 하기 response, request, filterChain을 mock 객체로 생성하여 given()으로 filterChain.doFileter() 메서드를 mock 으로 응답받을 수 있다. @ExtendWith(MockitoExtension.class) class JwtExceptionHandlerFilterTest { HttpServletResponse response = null; HttpServletRequest request = null; FilterChain filterChain = null; PrintWriter mockWriter = null; @BeforeEach private void setUp() throws IOException { //..
오늘의 삽질 테스트 코드에서 자바 리플렉션으로 setter 사용하기 TimeStamped 클래스는 엔티티가 상속받는 Entity Listener 클래스이다. 이 클래스를 상속받은 엔티티가 저장될 때의 시점을 createdAt 필드에 저장한다. 보는바와 같이 setter가 없기 때문에 외부에서 수정할 수 없다! @Getter @MappedSuperclass @EntityListeners(AuditingEntityListener.class) public abstract class TimeStamped { @CreatedDate private LocalDate createdAt; } public class User extends TimeStamped { @Id @GeneratedValue(strategy = ..
오늘의 삽질 @AuthenticationPrincipal에서 받아온 User 객체를 EntityManager에서 사용하기. Habit @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "user_id") @JsonIgnore private User user; User @OneToMany(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.EAGER) private List habit; Habit과 User는 ManyToOne 연관관계를 가지고 있다. (연관관계의 주인은 Habit) 문제는 새로운 Habit을 생성하는 구조에서 사용되는 아래의 메서드이다. protected void setUser(U..
편의 메서드 User @OneToMany(mappedBy = "user", cascade = CascadeType.ALL) private List habit;Habit @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "user_id") @JsonIgnore private User user;User와 Habit은 다대일 양방향 관계이며 관계의 주인은 Habit이다. 연관관계의 주인이 Habit이기 때문에 정상적인 외래키 관리는 Habit의 setUser() 메서드를 사용한다. protected void setUser(User user) { this.user = user; } 동일한 트랜젝션 내 1차캐시에서 setUser를 사용한 persist 상태의 Habi..
Nginx 엔진엑스(Nginx)는 Igor Sysoev라는 러시아 개발자가 동시접속 처리에 특화된 웹 서버 프로그램이다. Apache보다 동작이 단순하고, 전달자 역할만 하기 때문에 동시접속 처리에 특화되어 있다. 1. 정적 파일을 처리하는 HTTP 서버로서의 역할 웹서버의 역할은 HTML, CSS, Javascript, 이미지와 같은 정보를 웹 브라우저(Chrome, Iexplore, Opera, Firefox 등)에 전송하는 역할을 한다. (HTTP 프로토콜을 준수) 2. 응용프로그램 서버에 요청을 보내는 리버스 프록시 역할 클라이언트가 프록시 서버에 요청하고 프록시 서버가 배후 서버(reverse server)로부터 데이터를 가져오는 역할을 한다. 여기서 프록시 서버가 Nginx, 리버스 서버가 응..