Esempio n. 1
0
 /**
  * Deletes all images for a movie
  *
  * @param movieId
  */
 public static void deleteForMovie(final Long movieId) {
   final Set<MovieImage> set = MovieImage.finder.where().eq("movie.id", movieId).findSet();
   if (CollectionUtils.isEmpty(set) == false) {
     for (final MovieImage image : set) {
       image.delete();
     }
   }
 }
Esempio n. 2
0
  /**
   * Creates a new {@link MovieImage}
   *
   * @param movieId
   * @param size
   * @param type
   */
  public static void createMovieImage(
      final Long movieId,
      final EImageSize size,
      final EImageType type,
      final EImageStoreType storeType) {
    final Movie movie = Movie.finder.byId(movieId);
    if (movie == null) {
      if (Logger.isErrorEnabled() == true) {
        Logger.error(
            "Could not fing movie with id: "
                + movieId
                + " for creating a: "
                + MovieImage.class.getName());
      }
      return;
    }

    final MovieImage image = new MovieImage();
    image.movie = movie;
    image.size = size;
    image.type = type;
    image.storeType = storeType;

    image.save();
  }