1 package org.hibernate.test.cid; 3 4 import java.util.ArrayList ; 5 import java.util.List ; 6 import java.util.GregorianCalendar ; 7 import java.math.BigDecimal ; 8 9 12 public class Customer { 13 private String customerId; 14 private String name; 15 private String address; 16 private List orders = new ArrayList (); 17 20 public String getAddress() { 21 return address; 22 } 23 26 public void setAddress(String address) { 27 this.address = address; 28 } 29 32 public String getCustomerId() { 33 return customerId; 34 } 35 38 public void setCustomerId(String customerId) { 39 this.customerId = customerId; 40 } 41 44 public String getName() { 45 return name; 46 } 47 50 public void setName(String name) { 51 this.name = name; 52 } 53 56 public List getOrders() { 57 return orders; 58 } 59 62 public void setOrders(List orders) { 63 this.orders = orders; 64 } 65 66 public Order generateNewOrder(BigDecimal total) { 67 Order order = new Order(this); 68 order.setOrderDate( new GregorianCalendar () ); 69 order.setTotal( total ); 70 71 return order; 72 } 73 } 74 | Popular Tags |