Interface ProductRepository

  • All Superinterfaces:
    org.springframework.data.repository.CrudRepository<Product,​Long>, org.springframework.data.jpa.repository.JpaRepository<Product,​Long>, org.springframework.data.repository.PagingAndSortingRepository<Product,​Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Product>, org.springframework.data.repository.Repository<Product,​Long>

    public interface ProductRepository
    extends org.springframework.data.jpa.repository.JpaRepository<Product,​Long>
    The ProductRepository contains methods used to query the database for items in the Product table.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Iterable<Product> getAllByNameContainsOrderByName​(String nameFragment)
      The Get method to return all Product objects with a partial match to the keyword by name.
      Iterable<Product> getAllByProfileAndNameContainsOrderByName​(Profile profile, String nameFragment)
      The Get method to return all Product objects with a partial match to the keyword by name, sold by a particular Profile.
      Iterable<Product> getAllByProfileOrderByName​(Profile profile)
      The Get method to return all Product objects sold by a particular Profile.
      • Methods inherited from interface org.springframework.data.repository.CrudRepository

        count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save
      • Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

        deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlush
      • Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

        findAll
      • Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

        count, exists, findAll, findOne
    • Method Detail

      • getAllByProfileOrderByName

        Iterable<Product> getAllByProfileOrderByName​(Profile profile)
        The Get method to return all Product objects sold by a particular Profile.
        Parameters:
        profile - The Profile with which the desired Product objects are associated.
        Returns:
        An Iterable containing all Product objects associated with the given Profile.
      • getAllByNameContainsOrderByName

        Iterable<Product> getAllByNameContainsOrderByName​(String nameFragment)
        The Get method to return all Product objects with a partial match to the keyword by name.
        Parameters:
        nameFragment - A String matched to a Product name.
        Returns:
        An Iterable containing all Product objects that match the keyword.
      • getAllByProfileAndNameContainsOrderByName

        Iterable<Product> getAllByProfileAndNameContainsOrderByName​(Profile profile,
                                                                    String nameFragment)
        The Get method to return all Product objects with a partial match to the keyword by name, sold by a particular Profile.
        Parameters:
        profile - The Profile that sells the requested Product objects.
        nameFragment - A String matched to a Product name.
        Returns:
        An Iterable containing all Product objects that match the keyword and are sold by the requested Profile.