Interface AllergyRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Allergy,String>, org.springframework.data.jpa.repository.JpaRepository<Allergy,String>, org.springframework.data.repository.ListCrudRepository<Allergy,String>, org.springframework.data.repository.ListPagingAndSortingRepository<Allergy,String>, org.springframework.data.repository.PagingAndSortingRepository<Allergy,String>, org.springframework.data.repository.query.QueryByExampleExecutor<Allergy>, org.springframework.data.repository.Repository<Allergy,String>

public interface AllergyRepository extends org.springframework.data.jpa.repository.JpaRepository<Allergy,String>
Repository for allergies
Version:
1.2
Author:
Stian Lyng and birk
  • Method Summary

    Modifier and Type
    Method
    Description
    Finds all allergies by product id
    Finds a allergy by its name

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

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

    count, exists, findAll, findBy, findOne
  • Method Details

    • findAllByProductsEan

      List<Allergy> findAllByProductsEan(long id)
      Finds all allergies by product id
      Parameters:
      id - the id of the product
      Returns:
      list of allergies
    • findByName

      Optional<Allergy> findByName(String name)
      Finds a allergy by its name
      Parameters:
      name - the name of the allergy
      Returns:
      optional of allergy if found