package devguide.advanced.extsub;

import devguide.advanced.baseproject.extsub.ProductsBaseImpl;

import oracle.jbo.Key;
import oracle.jbo.domain.Number;
import oracle.jbo.server.AttributeDefImpl;
import oracle.jbo.server.EntityDefImpl;
// ---------------------------------------------------------------------
// ---    File generated by Oracle ADF Business Components Design Time.
// ---    Custom code may be added to this class.
// ---    Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class CustomizedProductsBaseImpl extends ProductsBaseImpl {
    public static final int MAXATTRCONST = EntityDefImpl.getMaxAttrConst("devguide.advanced.baseproject.extsub.ProductsBase");
    private static EntityDefImpl mDefinitionObject;

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

    /**@return the definition object for this instance class.
     */
    public static synchronized EntityDefImpl getDefinitionObject() {
        if (mDefinitionObject == null) {
            mDefinitionObject = EntityDefImpl.findDefObject("devguide.advanced.extsub.CustomizedProductsBase");
        }
        return mDefinitionObject;
    }

    public String getChecksum() {
      return  "I am the CustomizedProduct Class";
    }
    
    /**Gets the attribute value for ProductName, using the alias name ProductName.
     */
    public String getProductName() {
        return super.getProductName();
    }

    /**Sets <code>value</code> as the attribute value for ProductName.
     */
    public void setProductName(String value) {
        super.setProductName(value);
    }

    /**getAttrInvokeAccessor: generated method. Do not modify.
     */
    protected Object getAttrInvokeAccessor(int index, 
                                           AttributeDefImpl attrDef) throws Exception {
        if (index == PRODUCTNAME) {
            return getProductName();
        }
        return super.getAttrInvokeAccessor(index, attrDef);
    }

    /**setAttrInvokeAccessor: generated method. Do not modify.
     */
    protected void setAttrInvokeAccessor(int index, Object value, 
                                         AttributeDefImpl attrDef) throws Exception {
        if (index == PRODUCTNAME) {
            setProductName((String)value);
            return;
        }
        super.setAttrInvokeAccessor(index, value, attrDef);
        return;
    }

    /**Creates a Key object based on given key constituents.
     */
    public static Key createPrimaryKey(Number productId) {
        return new Key(new Object[]{productId});
    }
}
