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

OrderItem

public class OrderItem extends Object
ejb.bean name="OrderItem" type="CMP" view-type="local" primkey-field="orderItemUId" schema="OrderItem" cmp-version="${ejb.cmp.version}"
ejb.value-object name="OrderItem" match="*"
ejb.transaction type="Required"
ejb.persistence table-name="T_ORDER_ITEM"
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
orderItemUId
private int
quantity
private double
unitPrice
private xpetstore.domain.catalog.ejb.Item
item
Constructors Summary
public OrderItem()

    
     
    
       
    
public OrderItem(int quantity, double unitPrice)

       setQuantity( quantity );
       setUnitPrice( unitPrice );
   
Methods Summary
public doublecalculateSubTotal()

ejb.interface-method
ejb.transaction type="Supports"

        return Math.max( getQuantity(  ) * getUnitPrice(  ), 0 );
    
public xpetstore.domain.catalog.ejb.ItemgetItem()

ejb.interface-method
ejb.relation name="orderItem-item" role-name="orderItem-refers_to-item" cascade-delete="yes" target-ejb="Item" target-role-name="item-is_refered_by-orderItems" target-multiple="yes"
ejb.value-object aggregate="xpetstore.domain.catalog.model.ItemValue" aggregate-name="Item" members="xpetstore.domain.catalog.interfaces.Item" members-name="Item" relation="external"
jboss.relation fk-column="itemId_fk" related-pk-field="itemId"
weblogic.column-map foreign-key-column="itemId_fk"

       return item;
    
public java.lang.IntegergetOrderItemUId()

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

       return orderItemUId;
    
public intgetQuantity()

ejb.persistence column-name="quantity"

       return quantity;
    
public doublegetUnitPrice()

ejb.persistence column-name="unitPrice"

       return unitPrice;
    
public voidsetItem(xpetstore.domain.catalog.ejb.Item item)

ejb.interface-method

       this.item = item;
    
public voidsetOrderItemUId(java.lang.Integer orderItemUId)

       this.orderItemUId = orderItemUId;
    
public voidsetQuantity(int quantity)

       this.quantity = quantity;
    
public voidsetUnitPrice(double unitPrice)

       this.unitPrice = unitPrice;