Examples of ProductEntity


Examples of com.restfully.shop.persistence.ProductEntity

   }

   public static void domain2entity(LineItemEntity entity, LineItem item)
   {
      entity.setId(item.getId());
      ProductEntity product = new ProductEntity();
      ProductResourceBean.domain2entity(product, item.getProduct());
      entity.setProduct(product);
      entity.setQuantity(item.getQuantity());
   }
View Full Code Here

Examples of com.restfully.shop.persistence.ProductEntity

   }

   public static void domain2entity(LineItemEntity entity, LineItem item)
   {
      entity.setId(item.getId());
      ProductEntity product = new ProductEntity();
      ProductResourceBean.domain2entity(product, item.getProduct());
      entity.setProduct(product);
      entity.setQuantity(item.getQuantity());
   }
View Full Code Here

Examples of com.restfully.shop.persistence.ProductEntity

      this.em = em;
   }

   public Response createProduct(Product product, UriInfo uriInfo)
   {
      ProductEntity entity = new ProductEntity();
      domain2entity(entity, product);
      em.persist(entity);
      em.flush();

      System.out.println("Created product " + 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.ProductEntity

              .setMaxResults(size)
              .getResultList();

      for (Object obj : productEntities)
      {
         ProductEntity entity = (ProductEntity) obj;
         list.add(entity2domain(entity));
      }
      // next link
      // If the size returned is equal then assume there is a next
      if (productEntities.size() == size)
View Full Code Here

Examples of com.restfully.shop.persistence.ProductEntity

      return products;
   }

   public Product getProduct(int id)
   {
      ProductEntity product = em.getReference(ProductEntity.class, id);
      return entity2domain(product);
   }
View Full Code Here

Examples of com.restfully.shop.persistence.ProductEntity

   private EntityManager em;

   @Override
   public Response createProduct(Product product, UriInfo uriInfo)
   {
      ProductEntity entity = new ProductEntity();
      domain2entity(entity, product);
      em.persist(entity);
      em.flush();

      System.out.println("Created product " + 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.ProductEntity

              .setMaxResults(size)
              .getResultList();

      for (Object obj : productEntities)
      {
         ProductEntity entity = (ProductEntity) obj;
         list.add(entity2domain(entity));
      }
      // next link
      // If the size returned is equal then assume there is a next
      if (productEntities.size() == size)
View Full Code Here

Examples of com.restfully.shop.persistence.ProductEntity

   }

   @Override
   public Product getProduct(int id)
   {
      ProductEntity product = em.getReference(ProductEntity.class, id);
      return entity2domain(product);
   }
View Full Code Here

Examples of com.restfully.shop.persistence.ProductEntity

      this.em = em;
   }

   public Response createProduct(Product product, UriInfo uriInfo)
   {
      ProductEntity entity = new ProductEntity();
      domain2entity(entity, product);
      em.persist(entity);
      em.flush();

      System.out.println("Created product " + 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.ProductEntity

              .setMaxResults(size)
              .getResultList();

      for (Object obj : productEntities)
      {
         ProductEntity entity = (ProductEntity) obj;
         list.add(entity2domain(entity));
      }
      // next link
      // If the size returned is equal then assume there is a next
      if (productEntities.size() == size)
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.