Interface Catalog<T extends Product>

All Superinterfaces:
CrudRepository<T,​ProductIdentifier>, Repository<T,​ProductIdentifier>, SalespointRepository<T,​ProductIdentifier>

@Repository
public interface Catalog<T extends Product>
extends SalespointRepository<T,​ProductIdentifier>
Repository interface for Products
Author:
Oliver Gierke
  • Method Details

    • findByCategory

      @Query("select p from #{#entityName} p where :category member of p.categories") Streamable<T> findByCategory​(String category)
      Returns all Products assigned to the given category.
      Parameters:
      category -
      Returns:
    • findByAllCategories

      default Streamable<T> findByAllCategories​(String... categories)
      Returns all Product that are assigned to all given categories.
      Parameters:
      categories - must not be null.
      Returns:
      Since:
      7.1
    • findByAllCategories

      @Query("select p from #{#entityName} p where (select count(c.id) from #{#entityName} p2 inner join p2.categories c where p2.id = p.id and c.id in :categories) = ?#{#categories.size().longValue()}") Streamable<T> findByAllCategories​(Collection<String> categories)
      Returns all Product that are assigned to all given categories.
      Parameters:
      categories - must not be null.
      Returns:
      Since:
      7.1
    • findByAnyCategory

      default Streamable<T> findByAnyCategory​(String... categories)
      Returns all Products that are assigned to any of the given categories.
      Parameters:
      categories - must not be null.
      Returns:
      Since:
      7.1
    • findByAnyCategory

      @Query("select p from #{#entityName} p join p.categories c where c in :categories") Streamable<T> findByAnyCategory​(Collection<String> categories)
      Returns all Products that are assigned to any of the given categories.
      Parameters:
      categories - must not be null.
      Returns:
      Since:
      7.1
    • findByName

      Streamable<T> findByName​(String name)
      Returns the Products with the given name.
      Parameters:
      name -
      Returns: