일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 생성자주입
- ioc컨테이너
- kotlin ::
- Atomicity
- 스프링
- 소프트웨어의 품격
- open-session-in-view
- jpa lazy
- kotlin 리팩터링
- 그래프큐엘
- 스프링부트 도커
- 토비의 스프링
- 자바 필터
- Spring
- 수정자주입
- spring formatter
- jpa no session
- 기능적 요구사항
- 스프링 포매터
- fetch join
- 스프링di
- 스프링시큐리티
- 동적파라미터
- method refetence
- 스프링 시큐리티 설정
- IOC
- 도커 이미지 빌드
- 정적팩토리메서드
- 비기능적 요구사항
- java predicate
- Today
- Total
목록전체 글 (109)
공부기록
연관관계의 주인 public class Member { @ManyToOne @JoinColumn(name = "team_id") private Team team; ... } 이렇게만 있어도 member.getTeam() 으로 객체그래프를 탐색할 수 있다. 하지만 반대쪽인 Team 객체에서는 List members 등과 같은 필드가 없기 때문에 Team에서 Member객체를 탐색할 수 없다. 추천하지는 않지만 아래와 같이 Team에서도 Member를 탐색할 수 있게끔 양방향관계를 갖고있다고 생각해보자. public class Team { @OneToMany(mappedBy = "team") private List members = new ArrayList(); ... } 엄밀히 말해서 엔티티에서는 양방향 ..
@Entity public class Team { @Id @GeneratedValue @Column(name = "team_id") private String id; ... @GeneratedValue에서 strategy 옵션 없을 때 h2데이터베이스(1.4.199)는 기본전략으로 시퀀스 씀. 이런 환경에서 id는 String타입일 때 insert 쿼리 안나가고 테이블 만드는 쿼리만 나감.. 그래서 이렇게 수정함 @Entity public class Team { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "team_id") private Long id; private String name; id는 Long타입으로. str..
Resource 리소스를 읽어오는 기능을 제공하는 인터페이스. ApplicationContext extends ResourceLoader @Component @RequiredArgsConstructor public class AppRunner implements ApplicationRunner { private final ResourceLoader resourceLoader; @Override public void run(ApplicationArguments args) throws Exception { Resource resource = resourceLoader.getResource("classpath:test.txt"); System.out.println("resource = " + resource...
준영속 상태 영속상태의 엔티티가 영속성 컨텍스트에서 분리(detached) 영속성 컨텍스트가 제공하는 기능 사용 불가. 준영속상태로 만드는 방법 em.detach(entity) -> 특정 엔티티만 준영속 상태로 전환 em.clear() -> 영속성 컨텍스트를 완전히 초기화. em.close() -> 영속성 컨텍스트를 종료.