Skip to content

Instantly share code, notes, and snippets.

@msbaek
Created December 21, 2025 03:59
Show Gist options
  • Select an option

  • Save msbaek/be34a512e4b2361f39d087b5f05e0cd1 to your computer and use it in GitHub Desktop.

Select an option

Save msbaek/be34a512e4b2361f39d087b5f05e0cd1 to your computer and use it in GitHub Desktop.
userRepository
public void updateName(Long id, String newName) {
User user = userRepository.findById(id).orElseThrow(); // 그냥 POJO
user.setName(newName);
userRepository.save(user); // 명시적. 호출 안 하면 아무 일도 없다.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment