it.reply.healty.innovapuglia.mstaccuino.database.repository

## Interface FarmaciRepository

- All Superinterfaces:
    org.springframework.data.repository.CrudRepository<Farmaco,String>, org.springframework.data.jpa.repository.JpaRepository<Farmaco,String>, org.springframework.data.repository.PagingAndSortingRepository<Farmaco,String>, org.springframework.data.repository.query.QueryByExampleExecutor<Farmaco>, org.springframework.data.repository.Repository<Farmaco,String>

      @Repository
      public interface FarmaciRepository
      extends org.springframework.data.jpa.repository.JpaRepository<Farmaco,String>

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Optional<Farmaco>` | `findActiveById(String id)` Recupera l'oggetto di tipo Farmaco attivo associati a un determinato ID.
    `List<Farmaco>` | `findAllActiveByIdNota(String idNota)` Recupera tutti i Farmaci attivi associati a un determinato ID di nota taccuino.

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

      `deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlush`

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

      `findAll`

    - ### 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.repository.query.QueryByExampleExecutor

      `count, exists, findAll, findBy, findOne`

- - ### Method Detail

    - #### findActiveById

          @Query(value="FROM Farmaco f WHERE f.id = :id AND f.attivo = true")
          Optional<Farmaco> findActiveById(@Param(value="id")
                                                                                                                String id)

      Recupera l'oggetto di tipo Farmaco attivo associati a un determinato ID.
      Parameters:
        `id` - ID dell'oggetto da trovare.
      Returns:
        Oggetto di tipo Farmaco attivo se trovato.

    - #### findAllActiveByIdNota

          @Query(value="from Farmaco d where d.nota.id = :idNota and d.attivo = true")
          List<Farmaco> findAllActiveByIdNota(@Param(value="idNota")
                                                                                                                            String idNota)

      Recupera tutti i Farmaci attivi associati a un determinato ID di nota taccuino.
      Parameters:
        `idNota` - ID del taccuino associato ai documenti.
      Returns:
        Lista di Farmaci attivi associati al taccuino specifico.

Copyright © 2024. All rights reserved.