FileDocCategorySizeDatePackage
OrderItem.javaAPI DocJBoss 4.2.12311Fri Jul 13 20:55:36 BST 2007xpetstore.domain

OrderItem

public class OrderItem extends Object implements Serializable
author
Herve Tchepannou
hibernate.class
table="T_ORDER_ITEM"

Fields Summary
private Item
_item
private long
_orderItemId
private int
_quantity
private double
_unitPrice
Constructors Summary
public OrderItem()

public OrderItem(Item item, int quantity)

        _item      = item;
        _quantity  = quantity;
        _unitPrice = item.getListPrice(  );
    
Methods Summary
public ItemgetItem()

return
Item
hibernate.many-to-one
column="item_fk" cascade="none"

        return _item;
    
public longgetOrderItemId()

return
long
hibernate.id
generator-class="vm.long"

        return _orderItemId;
    
public intgetQuantity()

return
int
hibernate.property

        return _quantity;
    
public doublegetSubTotal()

        return _quantity * _unitPrice;
    
public doublegetUnitPrice()

return
double
hibernate.property

        return _unitPrice;
    
public voidsetItem(Item item)
Sets the item.

param
item The item to set

        _item = item;
    
public voidsetOrderItemId(long orderItemUId)
Sets the orderItemUId.

param
orderItemUId The orderItemUId to set

        _orderItemId = orderItemUId;
    
public voidsetQuantity(int quantity)
Sets the quantity.

param
quantity The quantity to set

        this._quantity = quantity;
    
public voidsetUnitPrice(double unitPrice)
Sets the unitPrice.

param
unitPrice The unitPrice to set

        _unitPrice = unitPrice;