org.springframework.data.gemfire.examples.domain.Order.getId()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中org.springframework.data.gemfire.examples.domain.Order.getId()方法的一些代码示例,展示了Order.getId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Order.getId()方法的具体详情如下:
包路径:org.springframework.data.gemfire.examples.domain.Order
类名称:Order
方法名:getId

Order.getId介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-gemfire-examples

@Override
  public String toString() {
    return String.valueOf(getId());
  }
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

/**
 * Delete an order
 */
public boolean deleteOrder(Order order) {
  Assert.notNull(order, "order cannot be null");
  Assert.notNull(order.getId(), "order ID cannot be null");
  return deleteOrder(order.getId());
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

@Override
public Order save(Order order) {
  return orderTemplate.put(order.getId(), order);
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

/**
 * Create an order
 * @param order
 * @return
 */
public Order createOrder(Order order) {
  Assert.notNull(order, "order cannot be null");
  Assert.notNull(order.getId(),"order id cannot be null");
  Assert.notNull(order.getCustomerId(), "order customer ID cannot be null");
  Assert.notEmpty(order.getLineItems(),"order must contain at least one line item");
  
  log.debug("creating order ID:" + order.getId() );
  return orderDao.save(order);
  
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

/**
 * Create an order
 */
public Order createOrder(Order order) {
  Assert.notNull(order, "order cannot be null");
  Assert.notNull(order.getId(), "order ID cannot be null");
  Assert.notNull(order.getCustomerId(), "order customer ID cannot be null");
  Assert.notEmpty(order.getLineItems(), "order must contain at least one line item");
  Assert.notNull(order.getBillingAddress(), "order billing address cannot be null");
  log.debug("creating new order " + order.getId());
  return orderRepository.save(order);
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

/**
 * Delete an order
 */
public boolean deleteOrder(long id) {
  Order order = orderRepository.findById(id).orElse(null);
  if (order != null) {
    orderRepository.delete(order);
    log.debug("deleted order :" + order.getId());
    return true;
  }
  log.debug("cannot find order for id " + id);
  return false;
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

/**
 * Delete Customer and any customer orders. This runs in a transaction
 * 
 * @param customerId
 */
@Transactional("gemfireTransactionManager")
public void deleteCustomer(long customerId) {
  log.debug("deleting customer ID " + customerId);
  customerDao.delete(customerId);
  for (Order order: orderDao.findCustomerOrders(customerId)) {
    orderDao.delete(order.getId());
  }
  log.debug("deleted customer ID " + customerId);
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

@Scheduled(initialDelay = 2000L, fixedRate = 5000L)
public void fulfillOrder() {
  int customerIndex = random.nextInt(customerList.size());
  Customer customer = save(findCustomer(customerIndex));
  Order order = newOrder(customer);
  for (int count = Math.max(1, random.nextInt(6)); count > 0; count--) {
    int productIndex = random.nextInt(productList.size());
    Product product = save(findProduct(productIndex));
    order.add(newLineItem(product, Math.max(1, random.nextInt(3))));
  }
  orders.put(order.getId(), order);
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

private void findOrders() {
  log.debug("looking for orders for customer ID 2");
  
  for (Order order: orderService.findOrdersByCustomerId(2L)) {
    log.debug("found order ID " + order.getId() + " " + 
        order.getBillingAddress().getStreet() + " " + 
        order.getBillingAddress().getCity() + " " + 
        order.getBillingAddress().getCountry());
      for (LineItem lineItem: order.getLineItems()) {
        log.debug("product ID:" + lineItem.getProductId() + 
           " quantity:" + lineItem.getAmount() + 
           " unit price:" + lineItem.getUnitPrice().setScale(2,BigDecimal.ROUND_DOWN) + 
           " total price:" + lineItem.getTotal().setScale(2,BigDecimal.ROUND_DOWN));
      }
  }
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

System.in.read();
region.put(davesOrder.getId(), davesOrder);
region.put(aliciasFirstOrder.getId(), aliciasFirstOrder);
region.put(aliciasNextOrder.getId(), aliciasNextOrder);

相关文章