/*
 * Copyright (c) 2004, 2005, ADAPT project partners (IST-2001-37126).
 * 
 * CatalogItemBean.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 CatalogItemBean implements EntityBean
{
    public String ejbCreate(CatalogLocal catalog, ProductLocal product, String name, String description, String brand, float price)
        throws CreateException
    {
        setId(UniqueIdentifierGenerator.createUniqueIdentifier());
        setName(name);
        setDescription(description);
        setBrand(brand);
        setPrice(price);

        return null;
    }

    public void ejbPostCreate(CatalogLocal catalog, ProductLocal product, String name, String description, String brand, float price)
    {
        setCatalog(catalog);
        setProduct(product);
    }

    public abstract void setId(String id);

    public abstract String getId();

    public abstract void setName(String quantity);

    public abstract String getName();

    public abstract void setDescription(String description);

    public abstract String getDescription();

    public abstract void setBrand(String brand);

    public abstract String getBrand();

    public abstract void setPrice(float price);

    public abstract float getPrice();

    public abstract void setCatalog(CatalogLocal catalog);

    public abstract CatalogLocal getCatalog();

    public abstract void setProduct(ProductLocal product);

    public abstract ProductLocal getProduct();

    public void setEntityContext(EntityContext entityContext)
    {
    }

    public void unsetEntityContext()
    {
    }

    public void ejbActivate()
    {
    }

    public void ejbPassivate()
    {
    }

    public void ejbLoad()
    {
    }

    public void ejbStore()
    {
    }    

    public void ejbRemove()
    {
    }
}
