Ejemplo 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);
  }
Ejemplo 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;
  }