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

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

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

Order.<init>介绍

[英]Creates a new Order for the given Customer.
[中]为给定客户创建新订单。

代码示例

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

private static Order newOrder(Customer customer) {
  return new Order(id.incrementAndGet(), customer.getId(), customer.getAddresses().iterator().next());
}

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

@SuppressWarnings("unchecked")
public static void main(String args[]) throws IOException {
   if (args.length >= 1 && args[0].equalsIgnoreCase("partitionByCountry")) {
      log.debug("partitioning by country");
      partitionByCountry = true;
  }
  @SuppressWarnings("resource")
  ApplicationContext context = new ClassPathXmlApplicationContext("client/cache-config.xml");
  Region<OrderKey,Order> region = context.getBean(Region.class);
  //Create some orders
  Random rand = new Random(new Date().getTime());
  for (long orderId = 1; orderId <= 100; orderId++) {
    Address shipTo = new Address("Some Street","Some City",(orderId%3 == 0)?"UK":"US");
    Order order = new Order(orderId, (new Long(rand.nextInt(100)+1)),shipTo);
    OrderKey orderKey = getOrderKey(orderId,shipTo.getCountry());
    region.put(orderKey, order);
  }
}

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

System.out.println("Press <Enter> to update region " + region.getName());
System.in.read();
region.put(id, new Order(1L, 1L, new Address("street", "city",
  "country")));
System.out.println("Press <Enter> to quit");

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

for (long orderId = 1; orderId <= 100; orderId ++) {
  Order order = new Order(orderId,0L,address);
  int nLineItems  = random.nextInt(3) + 1;
  for (int i = 0; i<nLineItems; i++){

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

for (long orderId = 1; orderId <= 100; orderId ++) {
  Order order = new Order(orderId,0L,address);
  int nLineItems  = random.nextInt(3) + 1;
  for (int i = 0; i<nLineItems; i++){

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

Order order = new Order(orderId, 0L, address);
int nLineItems = 5;
for (int i = 0; i < nLineItems; i++) {

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

macbook.setAttribute("warantee", "included");
Order davesOrder = new Order(1L, 1L, new Address(
    "Dave Street", "Matthews", "USA"));
davesOrder.add(new LineItem(macbook));
Order aliciasFirstOrder = new Order(2L, 2L, new Address(
    "Alicia Street", "Keys", "USA"));
Order aliciasNextOrder = new Order(3L, 2L, new Address(
    "Alicia Street", "Keys", "USA"));

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

macbook.setAttribute("warantee","included");
Order davesOrder = new Order(1L, dave.getId(),new Address("Dave Street","Matthews","USA"));
Order aliciasFirstOrder = new Order(2L, alicia.getId(),new Address("Alicia Street","Keys","USA"));
Order aliciasNextOrder = new Order(3L, alicia.getId(),new Address("Alicia Street","Keys","USA"));

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

private void createOrders() {
  Customer dave = customerService.findByEmailAddress("dave@matthews.com");
  Order davesOrder = new Order(1L, dave.getId(),new Address("Dave Street","Matthews","USA"));
  Order aliciasFirstOrder = new Order(2L, alicia.getId(),new Address("Alicia Street","Keys","USA"));
  Order aliciasNextOrder = new Order(3L, alicia.getId(),new Address("Alicia Street","Keys","USA"));

相关文章