Created
July 19, 2022 14:10
-
-
Save atesibrahim/7017bdf91f1f04f19e05e5010b5f3cbc to your computer and use it in GitHub Desktop.
Couchbase Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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