package oracle.adfdi.demo.cf.model.vo;

import oracle.jbo.Key;
import oracle.jbo.RowIterator;
import oracle.jbo.RowSet;
import oracle.jbo.domain.Date;
import oracle.jbo.domain.Number;
import oracle.jbo.server.AttributeDefImpl;
import oracle.jbo.server.EntityImpl;
import oracle.jbo.server.ViewRowImpl;
// ---------------------------------------------------------------------
// ---    File generated by Oracle ADF Business Components Design Time.
// ---    Tue Feb 02 00:13:10 IST 2010
// ---    Custom code may be added to this class.
// ---    Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class ProductsVORowImpl extends ViewRowImpl {


    public static final int ENTITY_PRODUCTSEO = 0;

    /**
     * AttributesEnum: generated enum for identifying attributes and accessors. Do not modify.
     */
    public enum AttributesEnum {
        ProductId {
            public Object get(ProductsVORowImpl obj) {
                return obj.getProductId();
            }

            public void put(ProductsVORowImpl obj, Object value) {
                obj.setProductId((Number)value);
            }
        }
        ,
        ProductName {
            public Object get(ProductsVORowImpl obj) {
                return obj.getProductName();
            }

            public void put(ProductsVORowImpl obj, Object value) {
                obj.setProductName((String)value);
            }
        }
        ,
        ParentCategoryId {
            public Object get(ProductsVORowImpl obj) {
                return obj.getParentCategoryId();
            }

            public void put(ProductsVORowImpl obj, Object value) {
                obj.setParentCategoryId((Number)value);
            }
        }
        ,
        CategoryId {
            public Object get(ProductsVORowImpl obj) {
                return obj.getCategoryId();
            }

            public void put(ProductsVORowImpl obj, Object value) {
                obj.setCategoryId((Number)value);
            }
        }
        ,
        ProductStatus {
            public Object get(ProductsVORowImpl obj) {
                return obj.getProductStatus();
            }

            public void put(ProductsVORowImpl obj, Object value) {
                obj.setProductStatus((String)value);
            }
        }
        ,
        ExternalUrl {
            public Object get(ProductsVORowImpl obj) {
                return obj.getExternalUrl();
            }

            public void put(ProductsVORowImpl obj, Object value) {
                obj.setExternalUrl((String)value);
            }
        }
        ,
        SupplierId {
            public Object get(ProductsVORowImpl obj) {
                return obj.getSupplierId();
            }

            public void put(ProductsVORowImpl obj, Object value) {
                obj.setSupplierId((Number)value);
            }
        }
        ,
        CostPrice {
            public Object get(ProductsVORowImpl obj) {
                return obj.getCostPrice();
            }

            public void put(ProductsVORowImpl obj, Object value) {
                obj.setCostPrice((Number)value);
            }
        }
        ,
        WarrantyPeriodMonths {
            public Object get(ProductsVORowImpl obj) {
                return obj.getWarrantyPeriodMonths();
            }

            public void put(ProductsVORowImpl obj, Object value) {
                obj.setWarrantyPeriodMonths((Number)value);
            }
        }
        ,
        RowKey {
            public Object get(ProductsVORowImpl obj) {
                return obj.getRowKey();
            }

            public void put(ProductsVORowImpl obj, Object value) {
                obj.setRowKey((String)value);
            }
        }
        ,
        SuppliersROVO {
            public Object get(ProductsVORowImpl obj) {
                return obj.getSuppliersROVO();
            }

            public void put(ProductsVORowImpl obj, Object value) {
                obj.setAttributeInternal(index(), value);
            }
        }
        ,
        ParentCategoriesROVOAccessor {
            public Object get(ProductsVORowImpl obj) {
                return obj.getParentCategoriesROVOAccessor();
            }

            public void put(ProductsVORowImpl obj, Object value) {
                obj.setAttributeInternal(index(), value);
            }
        }
        ,
        CategoriesROVOAccessor {
            public Object get(ProductsVORowImpl obj) {
                return obj.getCategoriesROVOAccessor();
            }

            public void put(ProductsVORowImpl obj, Object value) {
                obj.setAttributeInternal(index(), value);
            }
        }
        ,
        SuppliersROVOAccessor {
            public Object get(ProductsVORowImpl obj) {
                return obj.getSuppliersROVOAccessor();
            }

            public void put(ProductsVORowImpl obj, Object value) {
                obj.setAttributeInternal(index(), value);
            }
        }
        ;
        private static AttributesEnum[] vals = null;
        private static int firstIndex = 0;

        public abstract Object get(ProductsVORowImpl object);

        public abstract void put(ProductsVORowImpl object, Object value);

        public int index() {
            return AttributesEnum.firstIndex() + ordinal();
        }

        public static int firstIndex() {
            return firstIndex;
        }

        public static int count() {
            return AttributesEnum.firstIndex() + AttributesEnum.staticValues().length;
        }

        public static AttributesEnum[] staticValues() {
            if (vals == null) {
                vals = AttributesEnum.values();
            }
            return vals;
        }
    }


    public static final int PRODUCTID = AttributesEnum.ProductId.index();
    public static final int PRODUCTNAME = AttributesEnum.ProductName.index();
    public static final int PARENTCATEGORYID = AttributesEnum.ParentCategoryId.index();
    public static final int CATEGORYID = AttributesEnum.CategoryId.index();
    public static final int PRODUCTSTATUS = AttributesEnum.ProductStatus.index();
    public static final int EXTERNALURL = AttributesEnum.ExternalUrl.index();
    public static final int SUPPLIERID = AttributesEnum.SupplierId.index();
    public static final int COSTPRICE = AttributesEnum.CostPrice.index();
    public static final int WARRANTYPERIODMONTHS = AttributesEnum.WarrantyPeriodMonths.index();
    public static final int ROWKEY = AttributesEnum.RowKey.index();
    public static final int SUPPLIERSROVO = AttributesEnum.SuppliersROVO.index();
    public static final int PARENTCATEGORIESROVOACCESSOR = AttributesEnum.ParentCategoriesROVOAccessor.index();
    public static final int CATEGORIESROVOACCESSOR = AttributesEnum.CategoriesROVOAccessor.index();
    public static final int SUPPLIERSROVOACCESSOR = AttributesEnum.SuppliersROVOAccessor.index();

    /**
     * This is the default constructor (do not remove).
     */
    public ProductsVORowImpl() {
    }

    /**
     * Gets ProductsEO entity object.
     * @return the ProductsEO
     */
    public EntityImpl getProductsEO() {
        return (EntityImpl)getEntity(0);
    }

    /**
     * Gets the attribute value for PRODUCT_ID using the alias name ProductId.
     * @return the PRODUCT_ID
     */
    public Number getProductId() {
        return (Number) getAttributeInternal(PRODUCTID);
    }

    /**
     * Sets <code>value</code> as attribute value for PRODUCT_ID using the alias name ProductId.
     * @param value value to set the PRODUCT_ID
     */
    public void setProductId(Number value) {
        setAttributeInternal(PRODUCTID, value);
    }

    /**
     * Gets the attribute value for PRODUCT_NAME using the alias name ProductName.
     * @return the PRODUCT_NAME
     */
    public String getProductName() {
        return (String) getAttributeInternal(PRODUCTNAME);
    }

    /**
     * Sets <code>value</code> as attribute value for PRODUCT_NAME using the alias name ProductName.
     * @param value value to set the PRODUCT_NAME
     */
    public void setProductName(String value) {
        setAttributeInternal(PRODUCTNAME, value);
    }

    /**
     * Gets the attribute value for PARENT_CATEGORY_ID using the alias name ParentCategoryId.
     * @return the PARENT_CATEGORY_ID
     */
    public Number getParentCategoryId() {
        return (Number) getAttributeInternal(PARENTCATEGORYID);
    }

    /**
     * Sets <code>value</code> as attribute value for PARENT_CATEGORY_ID using the alias name ParentCategoryId.
     * @param value value to set the PARENT_CATEGORY_ID
     */
    public void setParentCategoryId(Number value) {
        setAttributeInternal(PARENTCATEGORYID, value);
    }

    /**
     * Gets the attribute value for CATEGORY_ID using the alias name CategoryId.
     * @return the CATEGORY_ID
     */
    public Number getCategoryId() {
        return (Number) getAttributeInternal(CATEGORYID);
    }

    /**
     * Sets <code>value</code> as attribute value for CATEGORY_ID using the alias name CategoryId.
     * @param value value to set the CATEGORY_ID
     */
    public void setCategoryId(Number value) {
        setAttributeInternal(CATEGORYID, value);
    }

    /**
     * Gets the attribute value for PRODUCT_STATUS using the alias name ProductStatus.
     * @return the PRODUCT_STATUS
     */
    public String getProductStatus() {
        return (String) getAttributeInternal(PRODUCTSTATUS);
    }

    /**
     * Sets <code>value</code> as attribute value for PRODUCT_STATUS using the alias name ProductStatus.
     * @param value value to set the PRODUCT_STATUS
     */
    public void setProductStatus(String value) {
        setAttributeInternal(PRODUCTSTATUS, value);
    }

    /**
     * Gets the attribute value for EXTERNAL_URL using the alias name ExternalUrl.
     * @return the EXTERNAL_URL
     */
    public String getExternalUrl() {
        return (String) getAttributeInternal(EXTERNALURL);
    }

    /**
     * Sets <code>value</code> as attribute value for EXTERNAL_URL using the alias name ExternalUrl.
     * @param value value to set the EXTERNAL_URL
     */
    public void setExternalUrl(String value) {
        setAttributeInternal(EXTERNALURL, value);
    }

    /**
     * Gets the attribute value for SUPPLIER_ID using the alias name SupplierId.
     * @return the SUPPLIER_ID
     */
    public Number getSupplierId() {
        return (Number) getAttributeInternal(SUPPLIERID);
    }

    /**
     * Sets <code>value</code> as attribute value for SUPPLIER_ID using the alias name SupplierId.
     * @param value value to set the SUPPLIER_ID
     */
    public void setSupplierId(Number value) {
        if(value != null)
            setAttributeInternal(SUPPLIERID, value);
    }

    /**
     * Gets the attribute value for COST_PRICE using the alias name CostPrice.
     * @return the COST_PRICE
     */
    public Number getCostPrice() {
        return (Number) getAttributeInternal(COSTPRICE);
    }

    /**
     * Sets <code>value</code> as attribute value for COST_PRICE using the alias name CostPrice.
     * @param value value to set the COST_PRICE
     */
    public void setCostPrice(Number value) {
        setAttributeInternal(COSTPRICE, value);
    }

    /**
     * Gets the attribute value for WARRANTY_PERIOD_MONTHS using the alias name WarrantyPeriodMonths.
     * @return the WARRANTY_PERIOD_MONTHS
     */
    public Number getWarrantyPeriodMonths() {
        return (Number) getAttributeInternal(WARRANTYPERIODMONTHS);
    }

    /**
     * Sets <code>value</code> as attribute value for WARRANTY_PERIOD_MONTHS using the alias name WarrantyPeriodMonths.
     * @param value value to set the WARRANTY_PERIOD_MONTHS
     */
    public void setWarrantyPeriodMonths(Number value) {
        setAttributeInternal(WARRANTYPERIODMONTHS, value);
    }


    /**
     * Gets the attribute value for the calculated attribute RowKey.
     * @return the RowKey
     */
    public String getRowKey() {
        Key key = super.getKey();
        if(key == null)
            return "";
        return key.toStringFormat(false);
    }

    /**
     * Sets <code>value</code> as the attribute value for the calculated attribute RowKey.
     * @param value value to set the  RowKey
     */
    public void setRowKey(String value) {
        setAttributeInternal(ROWKEY, value);
    }


    /**
     * Gets the associated <code>RowIterator</code> using master-detail link SuppliersROVO.
     */
    public RowIterator getSuppliersROVO() {
        return (RowIterator)getAttributeInternal(SUPPLIERSROVO);
    }

    /**
     * Gets the view accessor <code>RowSet</code> ParentCategoriesROVOAccessor.
     */
    public RowSet getParentCategoriesROVOAccessor() {
        return (RowSet)getAttributeInternal(PARENTCATEGORIESROVOACCESSOR);
    }

    /**
     * Gets the view accessor <code>RowSet</code> CategoriesROVOAccessor.
     */
    public RowSet getCategoriesROVOAccessor() {
        return (RowSet)getAttributeInternal(CATEGORIESROVOACCESSOR);
    }

    /**
     * Gets the view accessor <code>RowSet</code> SuppliersROVOAccessor.
     */
    public RowSet getSuppliersROVOAccessor() {
        return (RowSet)getAttributeInternal(SUPPLIERSROVOACCESSOR);
    }

    /**
     * getAttrInvokeAccessor: generated method. Do not modify.
     * @param index the index identifying the attribute
     * @param attrDef the attribute

     * @return the attribute value
     * @throws Exception
     */
    protected Object getAttrInvokeAccessor(int index,
                                           AttributeDefImpl attrDef) throws Exception {
        if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
            return AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].get(this);
        }
        return super.getAttrInvokeAccessor(index, attrDef);
    }

    /**
     * setAttrInvokeAccessor: generated method. Do not modify.
     * @param index the index identifying the attribute
     * @param value the value to assign to the attribute
     * @param attrDef the attribute

     * @throws Exception
     */
    protected void setAttrInvokeAccessor(int index, Object value,
                                         AttributeDefImpl attrDef) throws Exception {
        if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
            AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);
            return;
        }
        super.setAttrInvokeAccessor(index, value, attrDef);
    }
}
