Enviar pesquisa
Carregar
스프링 실전 가이드
•
13 gostaram
•
936 visualizações
남윤 김
Seguir
Spring guide
Leia menos
Leia mais
Tecnologia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 265
Baixar agora
Baixar para ler offline
Recomendados
Jstl 8
Jstl 8
kashyapkhatri123
Frontin like-a-backer
Frontin like-a-backer
Frank de Jonge
IoC with PHP
IoC with PHP
Chris Weldon
How to build customizable multitenant web applications - PHPBNL11
How to build customizable multitenant web applications - PHPBNL11
Stephan Hochdörfer
Dependency Injection, Zend Framework and Symfony Container
Dependency Injection, Zend Framework and Symfony Container
Diego Lewin
Getting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with Thymeleaf
Masatoshi Tada
Practical Protocol-Oriented-Programming
Practical Protocol-Oriented-Programming
Natasha Murashev
droidparts
droidparts
Droidcon Berlin
Recomendados
Jstl 8
Jstl 8
kashyapkhatri123
Frontin like-a-backer
Frontin like-a-backer
Frank de Jonge
IoC with PHP
IoC with PHP
Chris Weldon
How to build customizable multitenant web applications - PHPBNL11
How to build customizable multitenant web applications - PHPBNL11
Stephan Hochdörfer
Dependency Injection, Zend Framework and Symfony Container
Dependency Injection, Zend Framework and Symfony Container
Diego Lewin
Getting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with Thymeleaf
Masatoshi Tada
Practical Protocol-Oriented-Programming
Practical Protocol-Oriented-Programming
Natasha Murashev
droidparts
droidparts
Droidcon Berlin
Android programming -_pushing_the_limits
Android programming -_pushing_the_limits
Droidcon Berlin
Web注入+http漏洞等描述
Web注入+http漏洞等描述
fangjiafu
DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)
Hendrik Ebbers
Connect.Tech- Level Up Your Game With TravisCI
Connect.Tech- Level Up Your Game With TravisCI
stable|kernel
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAX
IMC Institute
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native Side
Visual Engineering
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
stable|kernel
Scala ActiveRecord
Scala ActiveRecord
scalaconfjp
SCULPT! YOUR! TESTS!
SCULPT! YOUR! TESTS!
Taras Oleksyn
Explaination of angular
Explaination of angular
Kan-Han (John) Lu
Connect.Tech- Swift Memory Management
Connect.Tech- Swift Memory Management
stable|kernel
Building an app with Google's new suites
Building an app with Google's new suites
Toru Wonyoung Choi
JPA 2.0
JPA 2.0
Emiel Paasschens
2 introduction toentitybeans
2 introduction toentitybeans
ashishkirpan
Java Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom Tags
IMC Institute
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Toru Wonyoung Choi
To inject or not to inject: CDI is the question
To inject or not to inject: CDI is the question
Antonio Goncalves
Real World Dependency Injection - IPC11 Spring Edition
Real World Dependency Injection - IPC11 Spring Edition
Stephan Hochdörfer
Javascript Testing with Jasmine 101
Javascript Testing with Jasmine 101
Roy Yu
Extending burp with python
Extending burp with python
Hoang Nguyen
Javaee6 Overview
Javaee6 Overview
Carol McDonald
Design Summit - Rails 4 Migration - Aaron Patterson
Design Summit - Rails 4 Migration - Aaron Patterson
ManageIQ
Mais conteúdo relacionado
Mais procurados
Android programming -_pushing_the_limits
Android programming -_pushing_the_limits
Droidcon Berlin
Web注入+http漏洞等描述
Web注入+http漏洞等描述
fangjiafu
DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)
Hendrik Ebbers
Connect.Tech- Level Up Your Game With TravisCI
Connect.Tech- Level Up Your Game With TravisCI
stable|kernel
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAX
IMC Institute
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native Side
Visual Engineering
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
stable|kernel
Scala ActiveRecord
Scala ActiveRecord
scalaconfjp
SCULPT! YOUR! TESTS!
SCULPT! YOUR! TESTS!
Taras Oleksyn
Explaination of angular
Explaination of angular
Kan-Han (John) Lu
Connect.Tech- Swift Memory Management
Connect.Tech- Swift Memory Management
stable|kernel
Building an app with Google's new suites
Building an app with Google's new suites
Toru Wonyoung Choi
JPA 2.0
JPA 2.0
Emiel Paasschens
2 introduction toentitybeans
2 introduction toentitybeans
ashishkirpan
Java Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom Tags
IMC Institute
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Toru Wonyoung Choi
To inject or not to inject: CDI is the question
To inject or not to inject: CDI is the question
Antonio Goncalves
Real World Dependency Injection - IPC11 Spring Edition
Real World Dependency Injection - IPC11 Spring Edition
Stephan Hochdörfer
Javascript Testing with Jasmine 101
Javascript Testing with Jasmine 101
Roy Yu
Extending burp with python
Extending burp with python
Hoang Nguyen
Mais procurados
(20)
Android programming -_pushing_the_limits
Android programming -_pushing_the_limits
Web注入+http漏洞等描述
Web注入+http漏洞等描述
DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)
Connect.Tech- Level Up Your Game With TravisCI
Connect.Tech- Level Up Your Game With TravisCI
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAX
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native Side
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Scala ActiveRecord
Scala ActiveRecord
SCULPT! YOUR! TESTS!
SCULPT! YOUR! TESTS!
Explaination of angular
Explaination of angular
Connect.Tech- Swift Memory Management
Connect.Tech- Swift Memory Management
Building an app with Google's new suites
Building an app with Google's new suites
JPA 2.0
JPA 2.0
2 introduction toentitybeans
2 introduction toentitybeans
Java Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom Tags
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO Extended
To inject or not to inject: CDI is the question
To inject or not to inject: CDI is the question
Real World Dependency Injection - IPC11 Spring Edition
Real World Dependency Injection - IPC11 Spring Edition
Javascript Testing with Jasmine 101
Javascript Testing with Jasmine 101
Extending burp with python
Extending burp with python
Semelhante a 스프링 실전 가이드
Javaee6 Overview
Javaee6 Overview
Carol McDonald
Design Summit - Rails 4 Migration - Aaron Patterson
Design Summit - Rails 4 Migration - Aaron Patterson
ManageIQ
What's new in Java EE 6
What's new in Java EE 6
Antonio Goncalves
A Lifecycle Of Code Under Test by Robert Fornal
A Lifecycle Of Code Under Test by Robert Fornal
QA or the Highway
Introduction to Protractor
Introduction to Protractor
Jie-Wei Wu
Aprendendo solid com exemplos
Aprendendo solid com exemplos
vinibaggio
Performance Optimization of Rails Applications
Performance Optimization of Rails Applications
Serge Smetana
Extending burp with python
Extending burp with python
Harry Potter
Extending burp with python
Extending burp with python
Young Alista
Extending burp with python
Extending burp with python
Fraboni Ec
Extending burp with python
Extending burp with python
Tony Nguyen
Extending burp with python
Extending burp with python
Luis Goldster
Extending burp with python
Extending burp with python
James Wong
Scientific calcultor-Java
Scientific calcultor-Java
Shaibal Ahmed
SproutCore and the Future of Web Apps
SproutCore and the Future of Web Apps
Mike Subelsky
Designing REST API automation tests in Kotlin
Designing REST API automation tests in Kotlin
Dmitriy Sobko
Cleaning your architecture with android architecture components
Cleaning your architecture with android architecture components
Debora Gomez Bertoli
Java final project of scientific calcultor
Java final project of scientific calcultor
Md. Eunus Ali Rupom
Icpc2010 bettenburg
Icpc2010 bettenburg
SAIL_QU
Behavior driven oop
Behavior driven oop
Piyush Verma
Semelhante a 스프링 실전 가이드
(20)
Javaee6 Overview
Javaee6 Overview
Design Summit - Rails 4 Migration - Aaron Patterson
Design Summit - Rails 4 Migration - Aaron Patterson
What's new in Java EE 6
What's new in Java EE 6
A Lifecycle Of Code Under Test by Robert Fornal
A Lifecycle Of Code Under Test by Robert Fornal
Introduction to Protractor
Introduction to Protractor
Aprendendo solid com exemplos
Aprendendo solid com exemplos
Performance Optimization of Rails Applications
Performance Optimization of Rails Applications
Extending burp with python
Extending burp with python
Extending burp with python
Extending burp with python
Extending burp with python
Extending burp with python
Extending burp with python
Extending burp with python
Extending burp with python
Extending burp with python
Extending burp with python
Extending burp with python
Scientific calcultor-Java
Scientific calcultor-Java
SproutCore and the Future of Web Apps
SproutCore and the Future of Web Apps
Designing REST API automation tests in Kotlin
Designing REST API automation tests in Kotlin
Cleaning your architecture with android architecture components
Cleaning your architecture with android architecture components
Java final project of scientific calcultor
Java final project of scientific calcultor
Icpc2010 bettenburg
Icpc2010 bettenburg
Behavior driven oop
Behavior driven oop
Último
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Juan lago vázquez
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Orbitshub
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
Christopher Logan Kennedy
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Orbitshub
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
johnbeverley2021
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
apidays
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Andrey Devyatkin
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Zilliz
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
UiPathCommunity
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
Remote DBA Services
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
apidays
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
Samir Dash
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
apidays
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
Sandro Moreira
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
danishmna97
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2
Último
(20)
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
스프링 실전 가이드
1.
Spring Guide
2.
1.
3.
Layer VS Domain
4.
Layer Layer
5.
Domain
6.
domain : global : Infra:
7.
api : .
rest api api . domain : . Embeddable, Enum . dto : Request, Response . exception : Exception . Domain
8.
global . common : Value .
Request, Response . config : . error : . Exception Guide . util : . global
9.
infra . common : Value .
Request, Response . config : . error : . Exception Guide . util : . infra
10.
11.
Repository
12.
Aggregate
13.
14.
->
15.
, ->
16.
2. Lombok
17.
Lombok
18.
Lombok Lombok . … …
19.
@Data @ToString, @EqualsAndHashCode,
@Getter, @Setter, @RequiredArgsConstructor … … @Data
20.
Setter . @Setter
21.
Member Coupon ToString
. JPA Json . ToString
22.
ToString . @ToString(of =
{“…”}) . ToString
23.
@EqualsAndHashCode equals ( ) Set HashCode Lombok
*.class @EqualsAndHashCode ..
24.
@Builder @AllArgsConstructor . @Builder
25.
. , . @Builder
26.
, , . Builder
27.
. @Builder.Default Builder . POJO @Builder.Default
28.
JPA PROTECTED . Request HttpMessageConverter (
)
29.
lombok.config lombok . @Data . lombok.config
30.
( ) , , , …
31.
3.
32.
33.
.
34.
,
35.
*
36.
. . . .
37.
. . . .
38.
(state) (behavior) . . . .
39.
' (what)' '
(how)' . . . . .
40.
Sample Code
41.
' ' . . . .
. ' ' . .
42.
. , . . . , .
43.
- What/Who - . What/Who
. What/Who ' What' ' Who' . ' ' . .
44.
- . Tell, Don't . . . .
45.
. . .
46.
Sample Code
47.
, . .
48.
(knowing) * * *
49.
. " " . . . .
50.
- . . , .
51.
. . , , . . .
.
52.
Sample Code
53.
Sample Code
54.
55.
4. SOLID
56.
SOLID SRP: OCP: LSP: ISP: DIP:
57.
* … … SOLID
?
58.
: Open Close
Principle , . .
59.
60.
OCP PamentController ShinhanCardPaymentService . (OCP
) ( ) .
61.
API . API . API
.
62.
Request API RequestBody API
, . shinhanCardNumber, number Request .
63.
Request API API Request
. DIP ' .' . ( DIP .) Request .
64.
Request API ->
OCP if . . if . if . XXXPaymentService . PaymentController , , .
65.
OCP
66.
OCP
67.
OCP . PaymentController CardPayment . (
) ( ) ( ) . cardPaymentFactory . , .
68.
69.
: Dependency Inversion
Principle . . .
70.
. . . .
71.
72.
DIP ( ) (
)
73.
( ) (
) . JSON , . .
74.
, PaymentRequest Dto
CardType . . if . if .
75.
XXXPaymentService . PaymentController ,
, . . DIP OCP SOLID .
76.
DIP . . ( )
( ) . ( ) ( ) ( ) .
77.
PaymentController PaymentService cardPaymentFactory ShinhanCardPaymentService
. , PaymenrService OCP .
78.
79.
: Single Responsibility
Principle … …. . . (Actor) ?
80.
SRP
81.
SRP : : Actor Actor :
82.
SRP Actor Actor pay . Actor
. Actor Actor ( ) . Actor
83.
SRP( )
84.
SRP( ) . CardPaymentService payOverseas . ? payOverseas
pay .
85.
. Actor . ( =
Actor) .
86.
, ? Actor . Actor .
. , , SRP . .
87.
SRP( ) . CardPaymentService payOverseas . ? payOverseas
pay .
88.
SRP( ) PaymentService , . .
89.
: The Liskov
Substitution Principle . Exception . . .
90.
:
91.
: Sample Code
92.
: Coupon calculateDiscountAmount() item
getPrice() Item , Item SpecialItem Coupon calculateDiscountAmount item SpecialItem 0
93.
: instanceof LSP . Item
SpecialItem Item . instanceof SpecialItem . SpecialItem Item .
94.
: instanceof Item . SpecialItem .
OCP LSP Item . .
95.
:
96.
: Item SpecialItem . instanceof . Item . OCP
. LSP .
97.
5.
98.
?
99.
? …
100.
Spring Boot Test Bean
Context . .
101.
Spring Boot Test @SpringBootTest
. . @SpringBootTest . . . . @RunWith JUnit .
102.
Spring Boot Test
103.
Spring Boot Test properties:
{key=value} . classes: . @SpringBootConfiguration . webEnvironment: . Mock @ActiveProfiles("test") @Transactional . WebEnvironment.RANDOM_PORT, DEFINED_PORT . @Transactional rollback .
104.
@WebMvcTest
105.
@DataJpaTest @DataJpaTest JPA . ,
JPA , , . . @Entity JPA .
106.
@DataJpaTest
107.
@DataJpaTest @AutoConfigureTestDatabase Replace.Any . @AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@ActiveProfiles("test") . @DataJpaTest . .
108.
@RestClientTest @RestClientTest REST . REST
JSON .
109.
@RestClientTest @RestClientTest Bean . @Rule
@Before, @After . . MockRestServiceServer REST . RestTemplate . . rest_test() . test.json ( .).
110.
1. Mock Service
= POJO 2. WebMvc Test 3. Spring Boot Test
111.
Code
112.
Code
113.
Repository Test Code
114.
POJO Code
115.
116.
POJO Test , Spring
Boot . Slice . POJO POJO . POJO POJO . . .
117.
POJO Document
118.
Matchers AssertJ . assertThat(coupon.isUsed())
. .
119.
Controller json . json .
120.
Controller
121.
122.
Import Set up SQL
given when, then . . . . member insert . data.sql .
123.
Import Set up
->
124.
Junit5 With Kotlin
& Spring Boot 2.2
125.
126.
127.
128.
Junit5 With Kotlin
& Spring Boot 2.2
129.
Junit5 With Kotlin
& Spring Boot 2.2
130.
Junit5 With Kotlin
& Spring Boot 2.2
131.
Junit5 With Kotlin
& Spring Boot 2.2 * AssertJ BDD BDDAssertion .
132.
133.
134.
6. Exception
135.
Exception ?
136.
. .
137.
. .
138.
Exception
139.
. . . .
140.
. . UnCheckedException . :
141.
. ( ) .
( ) Catch . ( ) Catch . ( )
142.
Try Catch
143.
Check Exception VS
UnChecked Exception Error . Error … Checked, Unchecked Exception Checked = . ( , ) -> Unchecked = Runtime Exception
144.
Check Exception VS
UnChecked Exception Error . Error … Checked, Unchecked Exception Checked = . ( , ) -> Unchecked =
145.
Check Exception JsonProcessingException IOException Exception
Checked Exception . throws try catch throw . . Unchecked Exception .
146.
Rollback
147.
Rollback (1) RuntimeException yun member rollback
. (2) IOException wan rollback commit . member yun, wan insert yun rollback wan rollback commit .
148.
Checked Exception Rollback
?
149.
Checked Exception Rollback
? Checked Exception . . . Rollback ( 100%)
150.
Checked Exception Rollback
? .
151.
…
152.
(1)… Checked Exception . SQLException ? +
insert RuntimeException .
153.
(1)… Exception Exception . DuplicateEmailException (Unchecked
Exception) . Checked Exception Unchecked Exception . JPA Checked Exception RuntimeException .
154.
Checked Exception . throw try
catch . .
155.
Unckecked Exception Checked Exception
Unckecekd Exception . .
156.
API Server Exception
157.
Error Response Error Response
Error Response . . Map<Key, Value> . .
158.
Error Response message :
message . status : http status code . header . errors : field, value, reason . @Valid JSR 303: Bean Validation . errors null [] . null . null . code :
159.
Error Response ErrorResponse .
POJO errorResponse.getXXX(); . Exception ErrorResponse . .
160.
@ControllerAdvice @ExceptionHandler Error Response . BusinessException .
.
161.
Error Code enum . , . C001
enum . Common .
162.
Business Exception Business Exception
Exception . . Exception . Exception Business Exception . Exception . . . , , . Exception .
163.
BusinessException BusinessException InvalidValueException, EntityNotFoundExceptuon
. InvalidValueException : Excetion , EntityNotFoundException : findById, findByCode
164.
BusinessException BusinessException . BusinessException . handleBusinessException . .
BusinessException .
165.
. . . . Bean Validation .
@ControllerAdvice . .
166.
Custom Validation (1) Bean
Validation . .
167.
Custom Validation (1)
168.
Custom Validation (1)
169.
Custom Validation (2) JSR
303 Validation . @NotNull, @NotEmpty, @Email Validation . , . JSON account, card paymentMethod @NotNull, @NotEmpty . ConstraintValidator .
170.
ConstraintValidator ConstraintValidator Validation ConstraintValidator . .
Validation , ( ) .
171.
ConstraintValidator . Interceptor . ConstraintValidator (Interceptor
) .
172.
ErrorResponse - Error Response ErrorReponse
. ConstraintValidator @Valid MethodArgumentNotValidException @ControllerAdvice ErrorResponse .
173.
ErrorResponse
174.
ConstraintValidator
175.
ConstraintValidator
176.
7.
177.
178.
bRepository.save(B("B")) aRepository.save(A("A")) Rollback .
179.
CGLIB Proxy .
( Dynamic Proxy ) Proxy . AOP
180.
JPA Repository interface
?
181.
@Transactional aRepository, bRepository
. Service .
182.
bRepository.save(B("B")) exception bRepository.save(B("B")), aRepository.save(A("A"))
rollback .
183.
Isolation Level 5
184.
185.
186.
SQL 10 sleep increase()
RuntimeException READ_UNCOMMITTED, READ_COMMITTED
187.
188.
1 . ( ) 2
( READ_UNCOMMITTED 2 1 ) 1 wake up Exception 2 15 Duty Read .
189.
READ_COMMITTED . 2 1 . . READ_COMMITED DB . / .
190.
1. 1 sleep
( ) 2. 2 . ( READ_COMMITTED .) 3. 1 . Nonrepeatable Read REPEATABLE_READ 1 , 2
191.
. REPEATABLE_READ . REPEATABLE_READ 1. 1
sleep ( ) 2. 2 1 . REPEATABLE_READ DB . / .
192.
1. 1 2. 2
insert 3. 1 ( ) . SERIALIZABLE . SERIALIZABLE . SERIALIZABLE
193.
194.
: Lost Update
195.
: Lost Update T1,
T2 . T1 , T2 T1 T1 T2 . T1 T2 T1 .
196.
197.
. . . DBMS . . .
198.
. . -> . ->
199.
1 2 , 2 1 . 1 .
2 . 1 2 2 1 . .
200.
1. 2. 3. . 4. . . 5. .
201.
DBMS . DBMS for update . JPA
EntityManager LockModeType find() , LockModeType.PESSIMISTIC_WRITE . JPA DBMS , PESSIMISTIC_WRITE for update .
202.
1. 1: A 2.
2: B 3. 1: B 4. 2 : A . 1 2 . , . . . JPA . JPA javax.persistence.lock.timeout . . (DBMS . )
203.
Isolcation Level REPEATABLE_READ
DB . 1 2 . JPA REPEATABLE_READ . In JPA
204.
JPA . 1 A
, B . Commit . REPEATABLE_READ ( ) 1 REPEATABLE_READ . In JPA
205.
A B . second lost
updates problem . . . 3 . 1. : A B . 2. : A B . 3. : A B .
206.
1. . 2. . . 3. . 4.
1 .
207.
. . , . , . DBMS .
208.
. 1 , . . 1 .
, .
209.
1. 1 2. 2 3.
1 ( 2 ), 6 . 4. 2 , 6 2
210.
JPA . @Version . JPA UPDATE @Version .
10 UP- DATE .
211.
. Repository . JPA .
212.
Flow
213.
Application Event
214.
Application Event ( ) (
, )
215.
Application Event OrderService . ,
OrderService . Application Event .
216.
Application Event - Application
Event Subscriber . OrderService .
217.
Application Event (Item) ,
event . . . .
218.
JPA
219.
JPA Setter
220.
, , setter . setter . Setter
.
221.
Account updateMyAccount . . MyAccountReq . DTO . Setter
.
222.
setter . . setter setter .
223.
JPA
224.
. . 1:1 OneToOne . . ? OneToOne
225.
. JPA ( , ,
) . ?
226.
order coupon_id SQL . coupon coupon
order order INSERT SQL , coupon order_id 2 . Order : INSERT SQL
227.
OneToOne . order coupon_id coupon order_id . OneToMany . . Order
:
228.
OneToOne , . OneToMany Many
. OneToMany OneToMany . OneToOne . <-> OneToOne . ( . ) .
229.
@JoinColumn nullable false
. NOT NULL . JPA DDL Spec .
230.
NOT NULL .
JPA SQL . NOT NULL . . .
231.
. applyCoupon .
232.
order . order 1,000 . null . .
233.
. 1:N . 1 OneToMany
234.
Delivery DeliveryLog PENDDING . Delivery
235.
CaseCade PERSIST Delivery DeliveryLog
. CaseCade PERSIST , insert query . Delivery
236.
JPA . . Delivery DeliveryLog . (orphanRemoval) :
DeliveryLog
237.
delivery, deliverylog Delivery . delete
SQL delivery_log delivery . orphanRemoval . (orphanRemoval) : Delivery
238.
DeliveryLog clear() DeliveryLog Delivery
DeliveryLog . (orphanRemoval) :
239.
Embedded
240.
String Email .
. . . Email String Email .
241.
String Account , . Account
. Account . . . Email Email . Email . . . (Rich Object)
242.
Money , ,
. .
243.
JPA N+1
244.
ERD
245.
N+1
246.
N+1
247.
N+1
248.
Member N+1
. N+1
249.
N+1 JPQL . findById() JPQL
SQL . . 1. JPQL . 2. . 3. ( ) .
250.
N+1 JPQL JPA SQL
. JPQL , JPQL SQL .
251.
: Batch Size @BatchSize(size
= 5) size . size where in size where in . spring.jpa.properties.hibernate.default_batch_fetch_size=1000 properties
252.
: Fetch fetch .
Fetch . Fetch .
253.
Fetch SQL . JPQL select
. Lazy N+1 .
254.
Fetch Fetch API
. limit offset . API . FULL Scan limit . Full Sacn . API .
255.
Fetch . . annot
simultaneously fetch multiple bag . List -> Set .
256.
Fetch . . annot
simultaneously fetch multiple bag . List -> Set .
257.
258.
Properties
259.
260.
key properties value . amount
100 int amount . . email email-address getProperty() email-address . 1 runtime NullPointException .
261.
: ConfigurationProperties
262.
263.
: ConfigurationProperties Immutable Properties
264.
@ConstructorBinding data class . 2.2.1 @ConfigurationProperties
scanning disabled @EnableConfigurationProperties .
265.
END
Baixar agora