@GET @Path("/process") @Produces(MediaType.APPLICATION_JSON) public List<Descriptor> processAllVines() { List<Vine> vines = vineRepository.findAllNotDescribedOrderedById(); for (int i = 0; i < vines.size(); i++) { try { Descriptor descriptor = new Descriptor(vines.get(i)); serviceDescriptor.save(descriptor); serviceVineDescribed.addVineDescribed(new VineDescribed(descriptor)); logger.info("ServiceVineDescribed contains " + serviceVineDescribed.getSize() + " units."); } catch (Exception e) { e.printStackTrace(); } } return descriptorRepository.findAllOrderedByVineID(); }
@GET @Produces(MediaType.APPLICATION_JSON) public List<Vine> listAllVines() { return vineRepository.findAllOrderedById(); }