/**
  * This gets all line items for this po and returns a collection of Value objects. This is
  * required because managed objects cant be accessed outside transaction bounsaries
  *
  * @return <Code>Collection</Code> of <Code>LineItem</Code> value objects
  */
 public Collection<LineItem> getAllItems() {
   Collection<?> liColl = getLineItems();
   if (liColl == null) return (null);
   ArrayList<LineItem> retVal = new ArrayList<LineItem>();
   Iterator<?> it = liColl.iterator();
   while ((it != null) && (it.hasNext())) {
     LineItemLocal loc = (LineItemLocal) it.next();
     retVal.add(loc.getData());
   }
   return (retVal);
 }
 public PurchaseOrder getData() {
   PurchaseOrder purchaseOrder = new PurchaseOrder();
   purchaseOrder.setOrderId(getPoId());
   purchaseOrder.setUserId(getPoUserId());
   purchaseOrder.setEmailId(getPoEmailId());
   purchaseOrder.setOrderDate(new Date(getPoDate()));
   purchaseOrder.setLocale(getPoLocale());
   purchaseOrder.setTotalPrice(getPoValue());
   purchaseOrder.setBillingInfo(getContactInfo().getData());
   purchaseOrder.setShippingInfo(purchaseOrder.getBillingInfo()); // XXX
   purchaseOrder.setCreditCard(getCreditCard().getData());
   Collection<?> lineItems = getLineItems();
   for (Iterator<?> iterator = lineItems.iterator(); iterator.hasNext(); ) {
     LineItemLocal lineItem = (LineItemLocal) iterator.next();
     purchaseOrder.addLineItem(lineItem.getData());
   }
   return purchaseOrder;
 }