Interface DataNeedsService

All Known Implementing Classes:
DataNeedsConfigService, DataNeedsDbService

public interface DataNeedsService
Service interface for retrieving data needs. Depending on the configuration, different data sources (e.g. JSON file or database) will be used.
  • Method Details

    • getDataNeedIdsAndNames

      List<DataNeedsNameAndIdProjection> getDataNeedIdsAndNames()
      Returns a list of all data needs with only their name and ID.
    • findById

      Optional<DataNeed> findById(String id)
      Fetches the data need with the passed ID from the underlying persistence layer.
      Parameters:
      id - The ID of the data need to get.
      Returns:
      The data need or an empty Optional if there is no data need with the given ID.
    • getById

      DataNeed getById(String id)
      Gets a data need by its id. If it cannot be found throws EntityNotFoundException. Should only be used when sure that the data need exists
      Parameters:
      id - The ID of the data need to get.
      Returns:
      the data need
      Throws:
      jakarta.persistence.EntityNotFoundException - if the entity cannot be found