Skip to content

Instantly share code, notes, and snippets.

@atesibrahim
Created July 19, 2022 14:10
Show Gist options
  • Save atesibrahim/7017bdf91f1f04f19e05e5010b5f3cbc to your computer and use it in GitHub Desktop.
Save atesibrahim/7017bdf91f1f04f19e05e5010b5f3cbc to your computer and use it in GitHub Desktop.
Couchbase Example
@AllArgsConstructor
@Service
public class BookService {
@Autowired
private BookRepository bookRepository;
public Book findById(String id) {
return bookRepository.findById(id).orElse(Book.builder().build());
}
public Book save(Book book) {
return bookRepository.save(book);
}
public void deleteById(String id) {
bookRepository.deleteById(id);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment