当前位置: 首页>>代码示例>>Java>>正文


Java Customer.addContact方法代码示例

本文整理汇总了Java中org.example.domain.Customer.addContact方法的典型用法代码示例。如果您正苦于以下问题:Java Customer.addContact方法的具体用法?Java Customer.addContact怎么用?Java Customer.addContact使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.example.domain.Customer的用法示例。


在下文中一共展示了Customer.addContact方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: insertTestCustAndOrders

import org.example.domain.Customer; //导入方法依赖的package包/类
private void insertTestCustAndOrders() {


    Customer cust1 = insertCustomer("Rob");
    cust1.addContact(new Contact("Jim", "Cricket"));
    cust1.addContact(new Contact("Barny", "Rubble"));
    cust1.addContact(new Contact("Bugs", "Bunny"));
    Contact contact = cust1.getContacts().get(0);
    contact.getUids().add(UUID.randomUUID());
    contact.getUids().add(UUID.randomUUID());
    contact.getSomeTags().add("red");
    contact.getSomeTags().add("green");
    contact.getSomeTags().add("blue");
    contact.getSomeLongs().add(42L);


    Ebean.save(cust1);

    Customer cust2 = insertCustomerNoAddress("Cust NoAddress");
    insertCustomerFiona("Fiona");
    insertCustomerNoContacts("NoContactsCust");

    createOrder1(cust1);
    createOrder2(cust2);
    createOrder3(cust1);
    createOrder4(cust1);
    createOrder5(cust2);
  }
 
开发者ID:ebean-orm,项目名称:ebean-elastic,代码行数:29,代码来源:SeedDbData.java

示例2: insertCustomerFiona

import org.example.domain.Customer; //导入方法依赖的package包/类
private Customer insertCustomerFiona(String name) {

    Customer c = createCustomer(name, "12 Apple St", "West Coast Rd", "2009-08-31");
    c.setStatus(Customer.Status.ACTIVE);

    c.addContact(createContact("Fiona", "Black"));
    c.addContact(createContact("Tracy", "Red"));

    Ebean.save(c);
    return c;
  }
 
开发者ID:ebean-orm,项目名称:ebean-elastic,代码行数:12,代码来源:SeedDbData.java

示例3: insertCustomerNoAddress

import org.example.domain.Customer; //导入方法依赖的package包/类
private Customer insertCustomerNoAddress(String name) {

    Customer c = new Customer();
    c.setName(name);
    c.setStatus(Customer.Status.NEW);
    c.addContact(createContact("Jack", "Black"));

    Ebean.save(c);
    return c;
  }
 
开发者ID:ebean-orm,项目名称:ebean-elastic,代码行数:11,代码来源:SeedDbData.java

示例4: insertCustomerNoAddress

import org.example.domain.Customer; //导入方法依赖的package包/类
private Customer insertCustomerNoAddress() {

    Customer c = new Customer("Jack Hill");
    c.addContact(createContact("Jack", "Black"));
    c.addContact(createContact("Jill", "Hill"));
    c.addContact(createContact("Mac", "Hill"));

    Ebean.save(c);
    return c;
  }
 
开发者ID:ebean-orm-examples,项目名称:example-java8,代码行数:11,代码来源:LoadExampleData.java

示例5: createCustomer

import org.example.domain.Customer; //导入方法依赖的package包/类
private static Customer createCustomer(String name, String shippingStreet, String billingStreet, int contactSuffix) {

    Customer c = new Customer(name);
    if (contactSuffix > 0) {
      c.addContact(new Contact("Jim" + contactSuffix, "Cricket"));
      c.addContact(new Contact("Fred" + contactSuffix, "Blue"));
      c.addContact(new Contact("Bugs" + contactSuffix, "Bunny"));
    }

    if (shippingStreet != null) {
      Address shippingAddr = new Address();
      shippingAddr.setLine1(shippingStreet);
      shippingAddr.setLine2("Sandringham");
      shippingAddr.setCity("Auckland");
      shippingAddr.setCountry(Country.find.ref("NZ"));

      c.setShippingAddress(shippingAddr);
    }

    if (billingStreet != null) {
      Address billingAddr = new Address();
      billingAddr.setLine1(billingStreet);
      billingAddr.setLine2("St Lukes");
      billingAddr.setCity("Auckland");
      billingAddr.setCountry(Ebean.getReference(Country.class, "NZ"));

      c.setBillingAddress(billingAddr);
    }

    return c;
  }
 
开发者ID:ebean-orm-examples,项目名称:example-java8,代码行数:32,代码来源:LoadExampleData.java

示例6: insertCustomerNoAddress

import org.example.domain.Customer; //导入方法依赖的package包/类
private Customer insertCustomerNoAddress() {

    Customer c = new Customer();
    c.setName("Cust NoAddress");
    c.addContact(createContact("Jack", "Black"));

    Ebean.save(c);
    return c;
  }
 
开发者ID:ebean-orm-examples,项目名称:avaje-ebeanorm-examples,代码行数:10,代码来源:LoadExampleData.java

示例7: createCustomer

import org.example.domain.Customer; //导入方法依赖的package包/类
public static Customer createCustomer(String name, String shippingStreet, String billingStreet, int contactSuffix) {

    Customer c = new Customer();
    c.setName(name);
    if (contactSuffix > 0) {
      c.addContact(new Contact("Jim" + contactSuffix, "Cricket"));
      c.addContact(new Contact("Fred" + contactSuffix, "Blue"));
      c.addContact(new Contact("Bugs" + contactSuffix, "Bunny"));
    }

    if (shippingStreet != null) {
      Address shippingAddr = new Address();
      shippingAddr.setLine1(shippingStreet);
      shippingAddr.setLine2("Sandringham");
      shippingAddr.setCity("Auckland");
      shippingAddr.setCountry(Ebean.getReference(Country.class, "NZ"));

      c.setShippingAddress(shippingAddr);
    }

    if (billingStreet != null) {
      Address billingAddr = new Address();
      billingAddr.setLine1(billingStreet);
      billingAddr.setLine2("St Lukes");
      billingAddr.setCity("Auckland");
      billingAddr.setCountry(Ebean.getReference(Country.class, "NZ"));

      c.setBillingAddress(billingAddr);
    }

    return c;
  }
 
开发者ID:ebean-orm-examples,项目名称:avaje-ebeanorm-examples,代码行数:33,代码来源:LoadExampleData.java

示例8: insertCustomerFiona

import org.example.domain.Customer; //导入方法依赖的package包/类
private Customer insertCustomerFiona() {

    Customer c = createCustomer("Fiona", "12 Apple St", "West Coast Rd", 1);

    c.addContact(createContact("Fiona", "Black"));
    c.addContact(createContact("Tracy", "Red"));

    Ebean.save(c);
    return c;
  }
 
开发者ID:ebean-orm-examples,项目名称:example-java8,代码行数:11,代码来源:LoadExampleData.java


注:本文中的org.example.domain.Customer.addContact方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。