本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}