View Javadoc
1   package org.imageconverter.domain.conversion;
2   
3   import java.util.Optional;
4   
5   import org.springframework.data.jpa.repository.JpaRepository;
6   import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
7   import org.springframework.data.repository.PagingAndSortingRepository;
8   
9   /**
10   * Image Conversion's repository
11   * 
12   * @author Fernando Romulo da Silva
13   */
14  public interface ImageConversionRepository extends JpaRepository<ImageConversion, Long>, JpaSpecificationExecutor<ImageConversion>, PagingAndSortingRepository<ImageConversion, Long> {
15  
16  //    @Query("select o from ImageConversion o where o.fileName = :fileName")
17      /**
18       * Find a image conversion by file name.
19       * 
20       * @param fileName The conversion file name
21       * @return A {@link Optional} with {@link ImageConversion} or a empty {@link Optional}
22       */
23      Optional<ImageConversion> findByFileName(String fileName);
24      
25      // Not supported yet
26      // Slice<ImageConversion> findAllSlice(Pageable page, Specification<ImageConversion> spec);
27  
28  }