/*
 * Copyright (c) 2004, ADAPT project partners (IST-2001-37126).
 * 
 * PurchaseOrderItemBean.java
 */

package org.eu.adapt.demonstrator.eb.retailer;

import javax.ejb.CreateException;
import javax.ejb.EntityContext;
import javax.ejb.EntityBean;
import org.eu.adapt.demonstrator.util.UniqueIdentifierGenerator;

public abstract class PurchaseOrderItemBean implements EntityBean
{
    public String ejbCreate(PurchaseOrderLocal purchaseOrder, ProductLocal product, int quantity, float price)
        throws CreateException
    {
        setNumber(UniqueIdentifierGenerator.createUniqueIdentifier());
        setQuantity(quantity);
        setPrice(price);

        return null;
    }

    public void ejbPostCreate(PurchaseOrderLocal purchaseOrder, ProductLocal product, int quantity, float price)
    {
        setPurchaseOrder(purchaseOrder);
        setProduct(product);
    }

    public abstract void setNumber(String number);

    public abstract String getNumber();

    public abstract void setQuantity(int quantity);

    public abstract int getQuantity();

    public abstract void setPrice(float price);

    public abstract float getPrice();

    public abstract void setProduct(ProductLocal product);

    public abstract ProductLocal getProduct();

    public abstract void setPurchaseOrder(PurchaseOrderLocal purchaseOrder);

    public abstract PurchaseOrderLocal getPurchaseOrder();

    public abstract void setWarehouse(WarehouseLocal warehouse);

    public abstract WarehouseLocal getWarehouse();

    public void setEntityContext(EntityContext entityContext)
    {
    }

    public void unsetEntityContext()
    {
    }

    public void ejbActivate()
    {
    }

    public void ejbPassivate()
    {
    }

    public void ejbLoad()
    {
    }

    public void ejbStore()
    {
    }    

    public void ejbRemove()
    {
    }
}
