Skip to content

Conversation

@Just-Roman
Copy link
Owner

No description provided.

private Integer duration;
private int likes;
private int likesCount;
List<Genre> genres;

Choose a reason for hiding this comment

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

Не указаны модификаторы доступа

@Past
@NotNull
private LocalDate birthday;
Set<Integer> friends;

Choose a reason for hiding this comment

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

Не указан модификатор доступа

public Collection<Genre> getAll() {
return genreDbStorage.getAll();
}

Choose a reason for hiding this comment

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

Слишком много пустых строк


private static final String GET_BY_ID = """
SELECT
f.id AS film_id,

Choose a reason for hiding this comment

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

Поля выборки можно так же вынести в отдельную строку, чтобы не дублировать их во всех запросах

return jdbc.query(GET_FILM_BY_LIKES, rowMapper, sizeFilms);
}

private static Integer getMaxIdMapper(ResultSet resultSet, int rowNum) throws SQLException {

Choose a reason for hiding this comment

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

static кажется излишним для приватных методов

}
}

private void validateIdMpa(Integer id) {

Choose a reason for hiding this comment

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

Кажется проще будет проверять путем нахождения mpa по переданном id, если не найден, то NotFoundException("Ваш id = " + id + " в таблице mpa не найден");

}
}

private void validateIdGenre(Integer id) {

Choose a reason for hiding this comment

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

Аналогичный комментарий для жанра

return jdbc.query(GET_ALL, GenreDbStorage::getGenreMapper);
}

private static Genre getGenreMapper(ResultSet resultSet, int rowNum) throws SQLException {

Choose a reason for hiding this comment

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

static кажется излишним для приватных методов

}


private static MpaRating getMpaRatingMapper(ResultSet resultSet, int rowNum) throws SQLException {

Choose a reason for hiding this comment

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

static кажется излишним для приватных методов

login VARCHAR(100) NOT NULL UNIQUE,
name VARCHAR(100),
birthday DATE NOT NULL,
friend_id INTEGER

Choose a reason for hiding this comment

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

Эта колонка кажется лишней, так как связь дружбы лежит в таблице friendship

@Just-Roman Just-Roman merged commit 9d9be28 into main May 1, 2025
2 checks passed
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