Merged
Conversation
slavrikk
reviewed
Apr 30, 2025
| private Integer duration; | ||
| private int likes; | ||
| private int likesCount; | ||
| List<Genre> genres; |
| @Past | ||
| @NotNull | ||
| private LocalDate birthday; | ||
| Set<Integer> friends; |
| public Collection<Genre> getAll() { | ||
| return genreDbStorage.getAll(); | ||
| } | ||
|
|
|
|
||
| private static final String GET_BY_ID = """ | ||
| SELECT | ||
| f.id AS film_id, |
There was a problem hiding this comment.
Поля выборки можно так же вынести в отдельную строку, чтобы не дублировать их во всех запросах
| return jdbc.query(GET_FILM_BY_LIKES, rowMapper, sizeFilms); | ||
| } | ||
|
|
||
| private static Integer getMaxIdMapper(ResultSet resultSet, int rowNum) throws SQLException { |
There was a problem hiding this comment.
static кажется излишним для приватных методов
| } | ||
| } | ||
|
|
||
| private void validateIdMpa(Integer id) { |
There was a problem hiding this comment.
Кажется проще будет проверять путем нахождения mpa по переданном id, если не найден, то NotFoundException("Ваш id = " + id + " в таблице mpa не найден");
| } | ||
| } | ||
|
|
||
| private void validateIdGenre(Integer id) { |
| return jdbc.query(GET_ALL, GenreDbStorage::getGenreMapper); | ||
| } | ||
|
|
||
| private static Genre getGenreMapper(ResultSet resultSet, int rowNum) throws SQLException { |
There was a problem hiding this comment.
static кажется излишним для приватных методов
| } | ||
|
|
||
|
|
||
| private static MpaRating getMpaRatingMapper(ResultSet resultSet, int rowNum) throws SQLException { |
There was a problem hiding this comment.
static кажется излишним для приватных методов
src/main/resources/schema.sql
Outdated
| login VARCHAR(100) NOT NULL UNIQUE, | ||
| name VARCHAR(100), | ||
| birthday DATE NOT NULL, | ||
| friend_id INTEGER |
There was a problem hiding this comment.
Эта колонка кажется лишней, так как связь дружбы лежит в таблице friendship
slavrikk
approved these changes
Apr 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.