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

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

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

public abstract class ItemBean implements EntityBean
{
    public String ejbCreate(FinishedGoodsLocal finishedGoods, int quantity, float price)
        throws CreateException
    {
        setId(UniqueIdentifierGenerator.createUniqueIdentifier());
        setQuantity(quantity);
        setPrice(price);

        return null;
    }

    public void ejbPostCreate(FinishedGoodsLocal finishedGoods, int quantity, float price)
    {
        setFinishedGoods(finishedGoods);
    }

    public abstract void setId(String id);

    public abstract String getId();

    public abstract void setQuantity(int quantity);

    public abstract int getQuantity();

    public abstract void setPrice(float price);

    public abstract float getPrice();

    public abstract void setFinishedGoods(FinishedGoodsLocal finishedGoods);

    public abstract FinishedGoodsLocal getFinishedGoods();

    public abstract void setPurchaseOrder(PurchaseOrderLocal purchaseOrder);

    public abstract PurchaseOrderLocal getPurchaseOrder();

    public abstract void setStorehouse(StorehouseLocal storehouse);

    public abstract StorehouseLocal getStorehouse();

    public void setEntityContext(EntityContext entityContext)
    {
    }

    public void unsetEntityContext()
    {
    }

    public void ejbActivate()
    {
    }

    public void ejbPassivate()
    {
    }

    public void ejbLoad()
    {
    }

    public void ejbStore()
    {
    }    

    public void ejbRemove()
    {
    }
}
