Пример #1
0
 @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();
 }
Пример #2
0
 @GET
 @Produces(MediaType.APPLICATION_JSON)
 public List<Vine> listAllVines() {
   return vineRepository.findAllOrderedById();
 }