-
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
done #312
base: main
Are you sure you want to change the base?
done #312
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, approved
Please check comments regarding naming for further
public interface ProductRepository extends JpaRepository<Product, Long> { | ||
List<Product> findAllByPriceBetween(BigDecimal from, BigDecimal to); | ||
|
||
List<Product> findAllByCategoryId(Long categories); |
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.
Plurals are used for Collections, Long with plural naming looks confusing
List<Product> findAllByCategoryId(Long categories); | |
List<Product> findAllByCategoryId(Long categoryId); |
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.
Yes, in the first version I wanted to use List there
|
||
List<Product> getAllWherePriceBetween(BigDecimal priceMin, BigDecimal priceMax); | ||
|
||
List<Product> getAllInCategories(Long categoryId); |
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.
Naming with "in" is usually used when we have List as argument to indicate we check all values in list. So such naming here is slightly confusing
List<Product> getAllInCategories(Long categoryId); | |
List<Product> getAllByCategory(Long categoryId); |
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.
fixed
No description provided.