JPA์ ๋ฐํ ํ์ ์ ์ข ๋ฅ
Data JPA์์ ๋ฐํ ํ์ ์ ์ง์ ํ ๋, ๋ค์๊ณผ ๊ฐ์ ๋ฐํ ํ์ ๋ค์ ์ง์ ํ ์ ์์ต๋๋ค.
- List<Member> : ์ปฌ๋ ์ , ๊ฒฐ๊ณผ๊ฐ ์์ผ๋ฉด ๋น ์ปฌ๋ ์ ์ ๋ฐํํฉ๋๋ค.
- Member : ๋จ๊ฑด(๊ฒฐ๊ณผ๊ฐ ์์ผ๋ฉด ๊ฒฐ๊ณผ๊ฐ null, ๊ฒฐ๊ณผ๊ฐ 2๊ฐ์ด๋ฉด ์๋ฌ๊ฐ ๋ฐ์ํฉ๋๋ค.)
- Optional<Member> : ๋จ๊ฑด optional(๊ฒฐ๊ณผ๊ฐ 2๊ฐ์ด๋ฉด ์๋ฌ๊ฐ ๋ฐ์ํฉ๋๋ค)
- ...
Spring Data JPA - Reference Documentation
Example 108. Using @Transactional at query methods @Transactional(readOnly = true) public interface UserRepository extends JpaRepository { List findByLastname(String lastname); @Modifying @Transactional @Query("delete from User u where u.active = false") v
docs.spring.io
์์ธํ ๋ณด๋ฉด CompletableFuture ๋ฑ๋ ๋ฐํ์ ์ง์ํฉ๋๋ค.
์ด๋ @Async์ ํจ๊ป ์ฌ์ฉํ์ฌ ๋น๋๊ธฐ์ ์ผ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค.
์ฝํ๋ฆฐ + JPA
https://ttl-blog.tistory.com/840
[์ฝํ๋ฆฐ][JPA] - ์ฝํ๋ฆฐ์์ JPA๋ฅผ ์ฌ์ฉํ ๋ Optional ๋์ nullableํ์ ์ฌ์ฉํ๊ธฐ
์ฝํ๋ฆฐ์์์ Optional Optional์ ์๋ฐ์์ null ๊ด๋ จ ์ฒ๋ฆฌ๋ฅผ ํด์ฃผ๊ธฐ ์ํด ๋ฑ์ฅํ์์ต๋๋ค. ๊ทธ๋ฌ๋ ์ฝํ๋ฆฐ์์๋ nullable ํ์ ์ ๋ฐ๋ก ์ฒ๋ฆฌํ๋ฏ๋ก Optional์ ์ฌ์ฉํ ํ์๊ฐ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด Optional.o
ttl-blog.tistory.com
Reference
Spring Data JPA - Reference Documentation
Example 108. Using @Transactional at query methods @Transactional(readOnly = true) public interface UserRepository extends JpaRepository { List findByLastname(String lastname); @Modifying @Transactional @Query("delete from User u where u.active = false") v
docs.spring.io
Spring Data JPA - Reference Documentation
Example 108. Using @Transactional at query methods @Transactional(readOnly = true) public interface UserRepository extends JpaRepository { List findByLastname(String lastname); @Modifying @Transactional @Query("delete from User u where u.active = false") v
docs.spring.io
์ค์ ! ์คํ๋ง ๋ฐ์ดํฐ JPA - ์ธํ๋ฐ | ๊ฐ์
์คํ๋ง ๋ฐ์ดํฐ JPA๋ ๊ธฐ์กด์ ํ๊ณ๋ฅผ ๋์ด ๋ง์น ๋ง๋ฒ์ฒ๋ผ, ๋ฆฌํฌ์งํ ๋ฆฌ์ ๊ตฌํ ํด๋์ค ์์ด ์ธํฐํ์ด์ค ๋ง์ผ๋ก ๊ฐ๋ฐ์ ์๋ฃํ ์ ์์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ ๋ฐ๋ณต ๊ฐ๋ฐํด์จ ๊ธฐ๋ณธ CRUD ๊ธฐ๋ฅ๋ ๋ชจ๋ ์ ๊ณตํฉ๋๋ค
www.inflearn.com
https://spring.io/guides/tutorials/spring-boot-kotlin/
Building web applications with Spring Boot and Kotlin
this tutorial is designed to be completed in 2-3 hours, it provides deeper, in-context explorations of enterprise application development topics, leaving you ready to implement real-world solutions.
spring.io
https://freedeveloper.tistory.com/139
[์คํ๋ง ๋ฐ์ดํฐ JPA] 3-6. ์คํ๋ง ๋ฐ์ดํฐ Common: ๋น๋๊ธฐ ์ฟผ๋ฆฌ
์คํ๋ง ๋ฐ์ดํฐ JPA 3. ์คํ๋ง ๋ฐ์ดํฐ Common ๋ณธ๊ฒฉ์ ์ธ ์คํ๋ง ๋ฐ์ดํฐ JPA ํ์ฉ๋ฒ์ ํ์ตํ๊ธฐ์ ์์, ORM๊ณผ JPA์ ๋ํ ์ด๋ก ์ ์ธ ๋ฐฐ๊ฒฝ์ ํ์ตํฉ๋๋ค ํฌ์คํ ์ฐธ์กฐ ์ ๋ณด GitHub ๊ณต๋ถํ ๋ด์ฉ์ GitHub์ ๊ณต๋ถ
freedeveloper.tistory.com
'๐๏ธ Spring > JPA' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Spring Data JPA] ๋ฒํฌ ์ฐ์ฐ (0) | 2022.07.28 |
---|---|
[JPA] ํ์ด์ง ์ ๋ฆฌ (JPA, Data JPA, QueryDSL) (1) | 2022.07.28 |
[Spring Data JPA] - ์ฟผ๋ฆฌ ๋ฉ์๋ ๊ธฐ๋ฅ (0) | 2022.07.28 |
[Spring Data JPA] - ์ค์ ๊ฐ๋ ์๊ฐ (0) | 2022.07.28 |
[JPA] ๋ณตํฉ ํค์ ์๋ณ ๊ด๊ณ ๋งคํ (0) | 2022.07.24 |