Skip to content

Implement Spring Data JPA, Liquibase and book update/delete endpoint - #4

Merged
xli1iax merged 3 commits into
mainfrom
feature/data-jpa
Aug 24, 2026
Merged

Implement Spring Data JPA, Liquibase and book update/delete endpoint#4
xli1iax merged 3 commits into
mainfrom
feature/data-jpa

Conversation

@xli1iax

@xli1iax xli1iax commented Aug 21, 2026

Copy link
Copy Markdown
Owner

No description provided.

@Elena-Bruyako Elena-Bruyako left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job
see comments

Comment thread src/main/java/boot/model/Book.java Outdated
@Setter
@Getter
@SQLDelete(sql = "UPDATE books SET is_deleted = true WHERE id=?")
@Where(clause = "is_deleted = false")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Where is deprecated, use @SQLRestriction instead

Book book = bookRepository.findById(id).orElseThrow(() ->
new EntityNotFoundException("Entity not found with id:" + id));

book.setTitle(bookDto.getTitle());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use mapper to update book

@Override
public BookDto updateBook(Long id, CreateBookRequestDto bookDto) {
Book book = bookRepository.findById(id).orElseThrow(() ->
new EntityNotFoundException("Entity not found with id:" + id));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
new EntityNotFoundException("Entity not found with id:" + id));
new EntityNotFoundException("Book not found with id:" + id));

@xli1iax
xli1iax requested a review from Elena-Bruyako August 23, 2026 07:10

@Elena-Bruyako Elena-Bruyako left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well done

@xli1iax
xli1iax merged commit c92905a into main Aug 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants