1 package org.hibernate.test.filter; 3 4 import java.util.Date ; 5 import java.util.List ; 6 import java.util.ArrayList ; 7 8 11 public class Order { 12 private Long id; 13 private String region; 14 private Date placementDate; 15 private Date fulfillmentDate; 16 private Salesperson salesperson; 17 private String buyer; 18 private List lineItems = new ArrayList (); 19 20 public Long getId() { 21 return id; 22 } 23 24 public void setId(Long id) { 25 this.id = id; 26 } 27 28 public String getRegion() { 29 return region; 30 } 31 32 public void setRegion(String region) { 33 this.region = region; 34 } 35 36 public Date getPlacementDate() { 37 return placementDate; 38 } 39 40 public void setPlacementDate(Date placementDate) { 41 this.placementDate = placementDate; 42 } 43 44 public Date getFulfillmentDate() { 45 return fulfillmentDate; 46 } 47 48 public void setFulfillmentDate(Date fulfillmentDate) { 49 this.fulfillmentDate = fulfillmentDate; 50 } 51 52 public Salesperson getSalesperson() { 53 return salesperson; 54 } 55 56 public void setSalesperson(Salesperson salesperson) { 57 this.salesperson = salesperson; 58 } 59 60 public String getBuyer() { 61 return buyer; 62 } 63 64 public void setBuyer(String buyer) { 65 this.buyer = buyer; 66 } 67 68 public List getLineItems() { 69 return lineItems; 70 } 71 72 protected void setLineItems(List lineItems) { 73 this.lineItems = lineItems; 74 } 75 76 public LineItem addLineItem(Product product, long quantity) { 77 return LineItem.generate(this, getLineItems().size(), product, quantity); 78 } 79 80 public void removeLineItem(LineItem item) { 81 removeLineItem( item.getSequence() ); 82 } 83 84 public void removeLineItem(int sequence) { 85 getLineItems().remove(sequence); 86 } 87 } 88 | Popular Tags |