인프런 커뮤니티 질문&답변
totalPrice
작성
·
421
2
안녕하세요 15:48 보시면
totalPrice 값이 나오는데 이 메소드는 언제 호출이 된건가요? 따로 호출해 준적이없는거 같습니다
==========
@GetMapping("/api/v1/simple-orders")
public List<Order> ordersV1(){
List<Order> all = orderRepository.findAllByString(new OrderSearch());
return all;
}
===========
public int getTotalPrice(){
int totalPrice = 0 ;
for(OrderItem orderItem : orderItems){
totalPrice+=orderItem.getTotalPrice();
}
return totalPrice;
}
퀴즈
56%나 틀려요. 한번 도전해보세요!
JPA 엔티티를 API 응답으로 직접 노출할 때 발생할 수 있는 주요 문제는 무엇일까요?
데이터 손실
무한 루프 발생
DB 연결 오류
메모리 누수






객체를 JSON으로 반환 하면 자동으로 해당 객체의 모든 getXX메서드를 호출하는건가요 ?!!