/**
* {@inheritDoc}
*/
@Override
public Long createOtherTitle(
@NotNull @Valid final OtherTitle otherTitle,
@NotNull final MovieEntity movie
) throws ResourceConflictException {
log.info("Called with otherTitle {}, movie {}", otherTitle, movie);
this.existsOtherTile(movie.getOtherTitles()
.stream()
.filter(ot -> ot.getStatus() == DataStatus.ACCEPTED)
.collect(Collectors.toList()), otherTitle);
final MovieOtherTitleEntity movieOtherTitle = new MovieOtherTitleEntity(otherTitle.getTitle(), otherTitle.getCountry());
movieOtherTitle.setMovie(movie);
movie.getOtherTitles().add(movieOtherTitle);
this.movieRepository.save(movie);
return Iterables.getLast(movie.getOtherTitles()).getId();
}
MoviePersistenceServiceImpl.java 文件源码
java
阅读 39
收藏 0
点赞 0
评论 0
项目:REST-Web-Services
作者:
评论列表
文章目录