Examples of OrderEntity


Examples of com.restfully.shop.persistence.OrderEntity

   }


   public Response getOrder(int id, UriInfo uriInfo)
   {
      OrderEntity entity = em.getReference(OrderEntity.class, id);
      Order order = entity2domain(entity);
      URI self = uriInfo.getAbsolutePathBuilder().build();
      Link selfLink = Link.fromUri(self).rel("self").type("application/xml").build();
      order.addLink(selfLink);
      if (!order.isCancelled())
View Full Code Here

Examples of com.restfully.shop.persistence.OrderEntity

      builder.link(cancelUri, "cancel");
   }

   public void cancelOrder(int id)
   {
      OrderEntity order = em.getReference(OrderEntity.class, id);
      order.setCancelled(true);
   }
View Full Code Here

Examples of com.restfully.shop.persistence.OrderEntity

      return builder.build();
   }

   public Response getOrderHeaders(int id, UriInfo uriInfo)
   {
      OrderEntity order = em.getReference(OrderEntity.class, id);
      Response.ResponseBuilder builder = Response.ok();
      builder.type("application/xml");
      if (!order.isCancelled()) addCancelHeader(uriInfo, builder);
      return builder.build();
   }
View Full Code Here

Examples of com.restfully.shop.persistence.OrderEntity

   }


   public Response getOrder(int id, UriInfo uriInfo)
   {
      OrderEntity entity = em.getReference(OrderEntity.class, id);
      Order order = entity2domain(entity);
      URI self = uriInfo.getAbsolutePathBuilder().build();
      Link selfLink = Link.fromUri(self).rel("self").type("application/xml").build();
      order.addLink(selfLink);
       if (!order.isCancelled())
View Full Code Here

Examples of com.restfully.shop.persistence.OrderEntity

      return builder.build();
   }

   public Response getOrderHeaders(int id, UriInfo uriInfo)
   {
      OrderEntity order = em.getReference(OrderEntity.class, id);
      Response.ResponseBuilder builder = Response.ok();
      builder.type("application/xml");
      if (!order.isCancelled()) addCancelHeader(uriInfo, builder);
      return builder.build();
   }
View Full Code Here

Examples of com.restfully.shop.persistence.OrderEntity

      builder.header("Link", new Link("purge", purgeUrl, null));
   }

   public Response createOrder(Order order, UriInfo uriInfo)
   {
      OrderEntity entity = new OrderEntity();
      domain2entity(entity, order);
      em.persist(entity);
      em.flush();
      System.out.println("Created order " + entity.getId());
      UriBuilder builder = uriInfo.getAbsolutePathBuilder();
      builder.path(Integer.toString(entity.getId()));
      return Response.created(builder.build()).build();

   }
View Full Code Here

Examples of com.restfully.shop.persistence.OrderEntity

              .setMaxResults(size)
              .getResultList();

      for (Object obj : orderEntities)
      {
         OrderEntity entity = (OrderEntity) obj;
         Order order = entity2domain(entity);
         String self = uriInfo.getAbsolutePathBuilder().path(Integer.toString(order.getId())).build().toString();
         order.addLink(new Link("self", self, "application/xml"));
         if (!order.isCancelled())
         {
View Full Code Here

Examples of com.restfully.shop.persistence.OrderEntity

      builder.header("Link", new Link("cancel", cancelUrl, null));
   }

   public void cancelOrder(int id)
   {
      OrderEntity order = em.getReference(OrderEntity.class, id);
      order.setCancelled(true);
   }
View Full Code Here

Examples of com.restfully.shop.persistence.OrderEntity

   }


   public Response getOrder(int id, UriInfo uriInfo)
   {
      OrderEntity entity = em.getReference(OrderEntity.class, id);
      Order order = entity2domain(entity);
      String self = uriInfo.getAbsolutePathBuilder().build().toString();
      order.addLink(new Link("self", self, "application/xml"));
      if (!order.isCancelled())
      {
View Full Code Here

Examples of com.restfully.shop.persistence.OrderEntity

      return builder.build();
   }

   public Response getOrderHeaders(int id, UriInfo uriInfo)
   {
      OrderEntity order = em.getReference(OrderEntity.class, id);
      Response.ResponseBuilder builder = Response.ok();
      builder.type("application/xml");
      if (!order.isCancelled()) addCancelHeader(uriInfo, builder);
      return builder.build();
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.