일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 자바
- db
- AOP
- Proxy
- pointcut
- 스프링 핵심 기능
- 알고리즘
- java
- Servlet
- kotlin
- transaction
- SpringBoot
- 그리디
- QueryDSL
- Spring Boot
- JDBC
- 스프링
- Exception
- spring
- springdatajpa
- jpa
- 스프링 핵심 원리
- 백준
- Android
- JPQL
- 인프런
- Greedy
- 김영한
- http
- Thymeleaf
- Today
- Total
목록persistence context (5)
개발자되기 프로젝트
1. 플러시 영속성 컨텍스트의 변경 내용을 DB에 반영 tx.commit() 실행되면 내부적으로 flush()실행됨. flush() 호출되면?? 무슨일이? - 변경감지, dirty checking - 수정된 엔티티 관련된 SQL을 생성하여 쓰기 지연 SQL저장소에 등록 - 쓰기지연 SQL 저장소의 쿼리를 DB에 전송(등록, 수정, 삭제) 영속성 컨텍스트를 flush하는 방법 - em.flush() 직접하든가 - tx.commit() 호출하면 flush() 자동으로 호출 됨. - JPQL 쿼리 실행하면 flush 자동 호출. 만약 persist(entity)하고 바로 JPQL을 통해 모든 엔티티 조회하면 DB에 반영이 안되어있기 때문에 불러올 수 없다. 따라서 JPA는 JPQL실행시 flush가 자동으로 ..
1. 엔티티조회, 1차 캐시 영속 상태는 1차 캐시에 올라가 있는 상태, persist, find로 1캐시에 들어간 상태. 영속성 컨텍스트 내부에는 "1차 캐시"가 있음 persist(entity)할 경우 1차 캐시에 저장됨. //엔티티를 생성한 상태(비영속) Member member = new Member(); member.setId("member1"); member.setUsername("회원1"); //엔티티를 영속 em.persist(member); @Id(PK)와 @Entity(객체)가 key & value로 1차캐시에 저장됨. 1차 캐시에서 id로 조회하는 경우 Member member = new Member(); member.setId("member1"); member.setUsername..
1. JPA에서 가~~장 중요한 두 가지 객체와 관계형 데이터베이스 매핑 (Object Relational Mapping) 💥영속성 컨텍스트 2. EntityManagerFactory와 EntityManager Hello JPA 1. JPA 구동방식 Persistence에서 설정정보 조회 EntityManagerFactory 생성 - EntityManagerFactory는 애플리케이션 로딩 시 딲! 하나 만 만들어 놔야함. - EntityManagerFactory 생성위해서는 PersistenceUnitN.. bsh-developer.tistory.com 3. Persistence Context(영속성 컨텍스트) JPA를 이해하는데 가장 중요한 용어 "엔티티를 영구 저장하는 환경"이라는 뜻 EntityM..
https://github.com/bsh6463/BookManager bsh6463/BookManager Contribute to bsh6463/BookManager development by creating an account on GitHub. github.com 1. Entity Manager Entity Manager란? Entity의 저장, 수정, 삭제, 업데이트 등 말그대로 entity를 관리함. 기존에 사용한 simple jpa repository는 직접적으로entity manager를 사용하지 않도록 감싸 spring에서 제공했음 실제 내부 동작은 entity manager을 통해서 이루어진다. 따라서 spring data jpa에서 제공하지 않는 기능을 사용하거나 특별히 custom을 할..
1. Context란? framework에서 container가 관리하고 있는 내용을 context라함 Spring의 경우 bean들을 로딩, 관리하는 작업들을 spring context위에서 활용되고 있음 즉, persistance container가 관리하고 있는 내용 * container, bean, Ioc Bean & Ioc & Application Context 1. Ioc(Inversion of Control) 스프링에서는 일반적인 JAVA 객체를 new로 생성하여 개발자가 관리하는 것이 아닌! Spring Container에 모두 맡긴다. 즉, 개발자에서 -> 프레임워크로 제어의 객체 관리의 권한이 bsh-developer.tistory.com 2. persistence란? 영속화, 사라지지..