-
Notifications
You must be signed in to change notification settings - Fork 343
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
base: main
Are you sure you want to change the base?
Homework: JV Spring Boot Data JPA #326
Conversation
There was a problem hiding this 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
<dependency> | ||
<groupId>com.mysql</groupId> | ||
<artifactId>mysql-connector-j</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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> { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)); |
There was a problem hiding this comment.
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
No description provided.