Esempio n. 1
0
  @Override
  public Service findByTitle(String title) throws ServiceNotFoundException {
    ServiceDAO serviceDAO = servicesRepository.findByTitle(title);

    if (serviceDAO == null)
      throw new ServiceNotFoundException("Service with title: " + title + " not exist.");

    return new Service(serviceDAO);
  }
Esempio n. 2
0
  @Override
  public List<Service> findAll() {
    List<ServiceDAO> serviceDAOs = servicesRepository.findAll();

    List<Service> services = new LinkedList<>();

    for (ServiceDAO serviceDAO : serviceDAOs) services.add(new Service(serviceDAO));

    return services;
  }