Inflearn Community Q&A
updateProfile에 영속성컨텍스트
Written on
·
297
0
안녕하세요.
updateProfile 메소드 내에 account 객체를 persistence로 만드는 방법과 관련해서 아래 소스와 같이 작성했는데요.
제가 생각한 것은 Id로 조회를 한 객체는 Persistence 상태이고, 값을 수정하면 update가 될것이라고 생각해서 작성했는데 update가 되지 않아 원인을 여쭤보고자 질문남깁니다.
답변 부탁드립니다. 감사합니다.
public void updateProfile(Account account, Profile profile) {
Optional<Account> byId = accountRepository.findById(account.getId());
Account reAccount = byId.get();
reAccount.setBio(profile.getBio());
reAccount.setUrl(profile.getUrl());
reAccount.setOccupation(profile.getOccupation());
reAccount.setLocation(profile.getLocation());
}springspring-bootthymeleafJPAjava
Quiz
66% of people got it wrong. Give it a try!
스프링 MVC에서 HTTP POST 요청 처리 후 리다이렉트 시, 다음 화면에 일회성으로 데이터를 전달하기 위해 사용되는 기능은 무엇일까요?
Model Attribute
Flash Attribute
Session Attribute
Request Attribute





