Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homework: JV Spring Boot Data JPA #326

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ViktorBykh
Copy link

No description provided.

Copy link

@sarakhmen sarakhmen left a comment

Choose a reason for hiding this comment

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

Good job, you can improve your solution if you want ;)

pom.xml Outdated
Comment on lines 51 to 55
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>

Choose a reason for hiding this comment

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

do you really this dependency here?

Copy link
Author

Choose a reason for hiding this comment

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

Not really)
I tested the code on MySQL and forgot about this dependency


import lombok.Data;

@Data

Choose a reason for hiding this comment

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

Let's not use @Data annotation. It's better to use Getter Setter etc. Please fix the same issue in all places

@Component
public class CategoryMapperImpl implements DtoMapper<CategoryRequestDto,
CategoryResponseDto, Category> {

Choose a reason for hiding this comment

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

Suggested change

Please remove redundant empty lines in all places

@Override
public Category getById(Long id) {
return categoryRepository.findById(id).orElseThrow(() ->
new RuntimeException("Can't find a category by id: " + id));

Choose a reason for hiding this comment

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

It's better to use NoSuchElementException here

@sarakhmen sarakhmen self-requested a review August 30, 2023 16:04
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