FileDocCategorySizeDatePackage
Order.javaAPI DocJBoss 4.2.18700Fri Jul 13 20:56:00 BST 2007xpetstore.domain.order.ejb

Order

public class Order extends Object
ejb.bean name="Order" type="CMP" view-type="local" primkey-field="orderUId" schema="Order" cmp-version="${ejb.cmp.version}"
ejb.value-object name="Order" match="*"
ejb.transaction type="Required"
ejb.persistence table-name="T_ORDER"
ejb.finder signature="Collection findByCustomer(java.lang.String userId)" query="SELECT OBJECT(o) FROM Order AS o WHERE o.customer.userId = ?1"
ejb.ejb-ref ejb-name="OrderItem" view-type="local" ref-name="ejb/OrderItemLocal"
ejb.ejb-ref ejb-name="UIDGenerator" view-type="local" ref-name="ejb/UIDGeneratorLocal"
jboss.persistence create-table="${jboss.create.table}" remove-table="${jboss.remove.table}"

Fields Summary
public static final String
COUNTER_NAME
private Integer
orderUid
private Date
orderDate
private String
status
private String
street1
private String
street2
private String
city
private String
state
private String
zipcode
private String
country
private String
creditCardNumber
private String
creditCardType
private String
creditCardExpiryDate
private Collection
orderItems
private xpetstore.domain.customer.ejb.Customer
customer
Constructors Summary
public Order()

    
     
    
    
Methods Summary
public voidaddOrderItem(OrderItem orderItem)

ejb.interface-method

       if (orderItems == null)
          orderItems = new java.util.ArrayList();
       
         orderItems.add(orderItem);
    
public doublecalculateTotal()

ejb.interface-method

        double   total = 0;
        Iterator it = getOrderItems(  ).iterator(  );
        while ( it.hasNext(  ) )
        {
            total += ( ( OrderItem ) it.next(  ) ).calculateSubTotal(  );
        }

        return total;
    
public voidchangeStatus(java.lang.String status)

ejb.interface-method

        setStatus( status );
    
public java.lang.StringgetCity()

ejb.persistence column-name="city" jdbc-type="VARCHAR" sql-type="varchar(25)"

       return city;
    
public java.lang.StringgetCountry()

ejb.persistence column-name="country" jdbc-type="VARCHAR" sql-type="varchar(3)"

       return country;
    
public java.lang.StringgetCreditCardExpiryDate()

ejb.persistence column-name="creditCardExpiryDate" jdbc-type="VARCHAR" sql-type="varchar(10)"

       return creditCardExpiryDate;
    
public java.lang.StringgetCreditCardNumber()

ejb.persistence column-name="creditCardNumber" jdbc-type="VARCHAR" sql-type="varchar(25)"

       return creditCardNumber;
    
public java.lang.StringgetCreditCardType()

ejb.persistence column-name="creditCardType" jdbc-type="VARCHAR" sql-type="varchar(25)"

       return creditCardType;
    
public xpetstore.domain.customer.ejb.CustomergetCustomer()

ejb.interface-method
ejb.relation name="order-customer" role-name="order-belongs_to-customer" target-ejb="Customer" target-role-name="customer-has-orders" target=multiple="yes"
jboss.relation fk-column="customer_fk" related-pk-field="userId"
weblogic.column-map foreign-key-column="customer_fk"

       return customer;
    
public java.util.DategetOrderDate()

ejb.persistence column-name="orderDate"

       return orderDate;
    
public java.util.CollectiongetOrderItems()

ejb.interface-method
ejb.relation name="order-orderItem" role-name="order-has-orderItems" target-ejb="OrderItem" target-role-name="orderItem-belongs_to-order" target-cascade-delete="yes"
jboss.target-relation fk-column="order_fk" related-pk-field="orderUId" fk-contraint="${db.foreign.key}
weblogic.target-column-map foreign-key-column="order_fk"

       return orderItems;
    
public java.lang.IntegergetOrderUId()

ejb.pk-field
ejb.persistence column-name="orderUId"
ejb.interface-method
ejb.transaction type="Supports"

       return orderUid;
    
public java.lang.StringgetState()

ejb.persistence column-name="state" jdbc-type="VARCHAR" sql-type="varchar(3)"

       return state;
    
public java.lang.StringgetStatus()

ejb.persistence column-name="status" jdbc-type="VARCHAR" sql-type="varchar(25)"

       return status;
    
public java.lang.StringgetStreet1()

ejb.persistence column-name="street1" jdbc-type="VARCHAR" sql-type="varchar(50)"

       return street1;
    
public java.lang.StringgetStreet2()

ejb.persistence column-name="street2" jdbc-type="VARCHAR" sql-type="varchar(50)"

       return street2;
    
public java.lang.StringgetZipcode()

ejb.persistence column-name="zipcode" jdbc-type="VARCHAR" sql-type="varchar(10)"

       return zipcode;
    
public voidsetCity(java.lang.String city)

       this.city = city;
    
public voidsetCountry(java.lang.String country)

       this.country = country;
    
public voidsetCreditCardExpiryDate(java.lang.String creditCardExpiryDate)

       this.creditCardExpiryDate = creditCardExpiryDate;
    
public voidsetCreditCardNumber(java.lang.String creditCardNumber)

       this.creditCardNumber = creditCardNumber;
    
public voidsetCreditCardType(java.lang.String creditCardType)

       this.creditCardType = creditCardType;
    
public voidsetCustomer(xpetstore.domain.customer.ejb.Customer customer)

ejb.interface-method

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

       this.orderDate = orderDate;
    
public voidsetOrderItems(java.util.Collection orderItems)

       this.orderItems = orderItems;
    
public voidsetOrderUId(java.lang.Integer orderUId)

       this.orderUid = orderUId;
    
public voidsetState(java.lang.String state)

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

       this.status = status;
    
public voidsetStreet1(java.lang.String street1)

       this.street1 = street1;
    
public voidsetStreet2(java.lang.String street2)

       this.street2 = street2;
    
public voidsetZipcode(java.lang.String zipcode)

       this.zipcode = zipcode;