Skip to content

completed DTO realisation, added requirments to pom.xml - #2

Merged
xli1iax merged 10 commits into
mainfrom
dto-branch
Feb 17, 2026
Merged

completed DTO realisation, added requirments to pom.xml#2
xli1iax merged 10 commits into
mainfrom
dto-branch

Conversation

@xli1iax

@xli1iax xli1iax commented Jan 24, 2026

Copy link
Copy Markdown
Owner

No description provided.

@RequiredArgsConstructor
@RestController
@RequestMapping("/books")
public class BookControllerImpl {

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
public class BookControllerImpl {
public class BookController {

Impl ending needed when you implements the interface.


@Override
public Optional<Book> findById(Long id) {
return Optional.ofNullable(sessionFactory.openSession().find(Book.class, 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.

I see that you opened a session and didn't close it. So let's use try-with-resources.

@@ -13,13 +17,28 @@ public class BookServiceImpl implements BookService {
@Autowired

@fetis-off fetis-off Jan 26, 2026

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
@Autowired

@Autowired annotation is redundant here. Remove it please.

@fetis-off fetis-off 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 one! Left a few comments.
And one additional comment: Please, update .gitignore file. Folders .idea and .target should not be in repository

@xli1iax
xli1iax requested a review from fetis-off January 26, 2026 21:40

@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.

fix conflicts in branch
see comment

Comment on lines +22 to +23
System.out.println("DTO: " + bookDto);
System.out.println("DTO author = " + bookDto.getAuthor());

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
System.out.println("DTO: " + bookDto);
System.out.println("DTO author = " + bookDto.getAuthor());

@xli1iax
xli1iax requested a review from Elena-Bruyako January 26, 2026 23:14

@fetis-off fetis-off 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.

Great work!

@xli1iax
xli1iax merged commit f02d31b into main Feb 17, 2026
2 checks passed
@xli1iax
xli1iax deleted the dto-branch branch August 21, 2026 17:09
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.

3 participants