FileDocCategorySizeDatePackage
Order.javaAPI DocExample6269Fri Dec 26 22:15:00 GMT 2003org.springframework.samples.jpetstore.domain

Order

public class Order extends Object implements Serializable

Fields Summary
private int
orderId
private String
username
private Date
orderDate
private String
shipAddress1
private String
shipAddress2
private String
shipCity
private String
shipState
private String
shipZip
private String
shipCountry
private String
billAddress1
private String
billAddress2
private String
billCity
private String
billState
private String
billZip
private String
billCountry
private String
courier
private double
totalPrice
private String
billToFirstName
private String
billToLastName
private String
shipToFirstName
private String
shipToLastName
private String
creditCard
private String
expiryDate
private String
cardType
private String
locale
private String
status
private List
lineItems
Constructors Summary
Methods Summary
public voidaddLineItem(CartItem cartItem)

    LineItem lineItem = new LineItem(lineItems.size() + 1, cartItem);
    addLineItem(lineItem);
  
public voidaddLineItem(LineItem lineItem)

    lineItems.add(lineItem);
  
public java.lang.StringgetBillAddress1()

 return billAddress1; 
public java.lang.StringgetBillAddress2()

 return billAddress2; 
public java.lang.StringgetBillCity()

 return billCity; 
public java.lang.StringgetBillCountry()

 return billCountry; 
public java.lang.StringgetBillState()

 return billState; 
public java.lang.StringgetBillToFirstName()

 return billToFirstName; 
public java.lang.StringgetBillToLastName()

 return billToLastName; 
public java.lang.StringgetBillZip()

 return billZip; 
public java.lang.StringgetCardType()

 return cardType; 
public java.lang.StringgetCourier()

 return courier; 
public java.lang.StringgetCreditCard()

 return creditCard; 
public java.lang.StringgetExpiryDate()

 return expiryDate; 
public java.util.ListgetLineItems()

 return lineItems; 
public java.lang.StringgetLocale()

 return locale; 
public java.util.DategetOrderDate()

 return orderDate; 
public intgetOrderId()


  /* JavaBeans Properties */

      return orderId; 
public java.lang.StringgetShipAddress1()

 return shipAddress1; 
public java.lang.StringgetShipAddress2()

 return shipAddress2; 
public java.lang.StringgetShipCity()

 return shipCity; 
public java.lang.StringgetShipCountry()

 return shipCountry; 
public java.lang.StringgetShipState()

 return shipState; 
public java.lang.StringgetShipToFirstName()

 return shipToFirstName; 
public java.lang.StringgetShipToLastName()

 return shipToLastName; 
public java.lang.StringgetShipZip()

 return shipZip; 
public java.lang.StringgetStatus()

 return status; 
public doublegetTotalPrice()

 return totalPrice; 
public java.lang.StringgetUsername()

 return username; 
public voidinitOrder(Account account, Cart cart)


    username = account.getUsername();
    orderDate = new Date();

    shipToFirstName = account.getFirstName();
    shipToLastName = account.getLastName();
    shipAddress1 = account.getAddress1();
    shipAddress2 = account.getAddress2();
    shipCity = account.getCity();
    shipState = account.getState();
    shipZip = account.getZip();
    shipCountry = account.getCountry();

    billToFirstName = account.getFirstName();
    billToLastName = account.getLastName();
    billAddress1 = account.getAddress1();
    billAddress2 = account.getAddress2();
    billCity = account.getCity();
    billState = account.getState();
    billZip = account.getZip();
    billCountry = account.getCountry();

    totalPrice = cart.getSubTotal();

    creditCard = "999 9999 9999 9999";
    expiryDate = "12/03";
    cardType = "Visa";
    courier = "UPS";
    locale = "CA";
    status = "P";

    Iterator i = cart.getAllCartItems();
    while (i.hasNext()) {
      CartItem cartItem = (CartItem) i.next();
      addLineItem(cartItem);
    }

  
public voidsetBillAddress1(java.lang.String billAddress1)

 this.billAddress1 = billAddress1; 
public voidsetBillAddress2(java.lang.String billAddress2)

 this.billAddress2 = billAddress2; 
public voidsetBillCity(java.lang.String billCity)

 this.billCity = billCity; 
public voidsetBillCountry(java.lang.String billCountry)

 this.billCountry = billCountry; 
public voidsetBillState(java.lang.String billState)

 this.billState = billState; 
public voidsetBillToFirstName(java.lang.String billToFirstName)

 this.billToFirstName = billToFirstName; 
public voidsetBillToLastName(java.lang.String billToLastName)

 this.billToLastName = billToLastName; 
public voidsetBillZip(java.lang.String billZip)

 this.billZip = billZip; 
public voidsetCardType(java.lang.String cardType)

 this.cardType = cardType; 
public voidsetCourier(java.lang.String courier)

 this.courier = courier; 
public voidsetCreditCard(java.lang.String creditCard)

 this.creditCard = creditCard; 
public voidsetExpiryDate(java.lang.String expiryDate)

 this.expiryDate = expiryDate; 
public voidsetLineItems(java.util.List lineItems)

 this.lineItems = lineItems; 
public voidsetLocale(java.lang.String locale)

 this.locale = locale; 
public voidsetOrderDate(java.util.Date orderDate)

 this.orderDate = orderDate; 
public voidsetOrderId(int orderId)

 this.orderId = orderId; 
public voidsetShipAddress1(java.lang.String shipAddress1)

 this.shipAddress1 = shipAddress1; 
public voidsetShipAddress2(java.lang.String shipAddress2)

 this.shipAddress2 = shipAddress2; 
public voidsetShipCity(java.lang.String shipCity)

 this.shipCity = shipCity; 
public voidsetShipCountry(java.lang.String shipCountry)

 this.shipCountry = shipCountry; 
public voidsetShipState(java.lang.String shipState)

 this.shipState = shipState; 
public voidsetShipToFirstName(java.lang.String shipFoFirstName)

 this.shipToFirstName = shipFoFirstName; 
public voidsetShipToLastName(java.lang.String shipToLastName)

 this.shipToLastName = shipToLastName; 
public voidsetShipZip(java.lang.String shipZip)

 this.shipZip = shipZip; 
public voidsetStatus(java.lang.String status)

 this.status = status; 
public voidsetTotalPrice(double totalPrice)

 this.totalPrice = totalPrice; 
public voidsetUsername(java.lang.String username)

 this.username = username;