Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * #%L
   * BroadleafCommerce Framework
   * %%
   * Copyright (C) 2009 - 2013 Broadleaf Commerce
   * %%
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
  * 
  *       http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * #L%
  */
 package org.broadleafcommerce.core.catalog.domain;
 
 
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
The Class ProductImpl is the default implementation of Product. A product is a general description of an item that can be sold (for example: a hat). Products are not sold or added to a cart. Skus which are specific items (for example: a XL Blue Hat) are sold or added to a cart.

If you want to add fields specific to your implementation of BroadLeafCommerce you should extend this class and add your fields. If you need to make significant changes to the ProductImpl then you should implement your own version of Product.

This implementation uses a Hibernate implementation of JPA configured through annotations. The Entity references the following tables: BLC_PRODUCT, BLC_PRODUCT_SKU_XREF, BLC_PRODUCT_IMAGE

Author(s):
btaylor
See also:
Product, SkuImpl, CategoryImpl
@javax.persistence.Table(name="BLC_PRODUCT")
//multi-column indexes don't appear to get exported correctly when declared at the field level, so declaring here as a workaround
@org.hibernate.annotations.Table(appliesTo = "BLC_PRODUCT", indexes = {
    @Index(name = "PRODUCT_URL_INDEX",
            columnNames = {"URL","URL_KEY"}
    )
})
@Cache(usage = ., region="blProducts")
@AdminPresentationClass(populateToOneFields = ., friendlyName = "baseProduct")
@SQLDelete(sql="UPDATE BLC_PRODUCT SET ARCHIVED = 'Y' WHERE PRODUCT_ID = ?")
        @DirectCopyTransformMember(templateTokens = ., skipOverlaps=true),
})
public class ProductImpl implements ProductStatusAdminMainEntityLocatable {
    private static final Log LOG = LogFactory.getLog(ProductImpl.class);
    
The Constant serialVersionUID.
    private static final long serialVersionUID = 1L;

    
The id.
    @Id
    @GeneratedValue(generator= "ProductId")
        name="ProductId",
        strategy="org.broadleafcommerce.common.persistence.IdOverrideTableGenerator",
        parameters = {
            @Parameter(name="segment_value", value="ProductImpl"),
            @Parameter(name="entity_name", value="org.broadleafcommerce.core.catalog.domain.ProductImpl")
        }
    )
    @Column(name = "PRODUCT_ID")
    @AdminPresentation(friendlyName = "ProductImpl_Product_ID", visibility = .)
    protected Long id;
    
    @Column(name = "URL")
    @AdminPresentation(friendlyName = "ProductImpl_Product_Url", order = ..,
        group = ..., groupOrder = ...
        prominent = true, gridOrder = 3, columnWidth = "200px",
            requiredOverride = .,
            validationConfigurations = { @ValidationConfiguration(validationImplementation = "blUriPropertyValidator") })
    protected String url;
    @Column(name = "URL_KEY")
    @AdminPresentation(friendlyName = "ProductImpl_Product_UrlKey",
        tab = ..., tabOrder = ...,
        group = ..., groupOrder = ...
        excluded = true)
    protected String urlKey;
    @Column(name = "DISPLAY_TEMPLATE")
    @AdminPresentation(friendlyName = "ProductImpl_Product_Display_Template"
        tab = ..., tabOrder = ...,
        group = ..., groupOrder = ...)
    protected String displayTemplate;
    @Column(name = "MODEL")
    @AdminPresentation(friendlyName = "ProductImpl_Product_Model",
        tab = ..., tabOrder = ...,
        group = ..., groupOrder = ...)
    protected String model;
    @Column(name = "MANUFACTURE")
    @AdminPresentation(friendlyName = "ProductImpl_Product_Manufacturer", order = ..,
        group = ..., groupOrder = ...
        prominent = true, gridOrder = 4)
    protected String manufacturer;
    
    @Column(name = "IS_FEATURED_PRODUCT", nullable=false)
    @AdminPresentation(friendlyName = "ProductImpl_Is_Featured_Product", requiredOverride = .,
        tab = ..., tabOrder = ...,
        group = ..., groupOrder = ...)
    protected Boolean isFeaturedProduct = false;
    
    @OneToOne(targetEntity = SkuImpl.class, cascade={.})
    @Cache(usage = ., region="blProducts")
    @JoinColumn(name = "DEFAULT_SKU_ID")
    @ClonePolicy(toOneProperty = "defaultProduct")
    protected Sku defaultSku;
    
    @Column(name = "CAN_SELL_WITHOUT_OPTIONS")
    @AdminPresentation(friendlyName = "ProductImpl_Can_Sell_Without_Options",
        tab = ..., tabOrder = ...,
        group = ..., groupOrder = ...)
    protected Boolean canSellWithoutOptions = false;
    
    @Transient
    protected List<Skuskus = new ArrayList<Sku>();
    
    @Transient
    protected String promoMessage;
    @OneToMany(mappedBy = "product", targetEntity = CrossSaleProductImpl.class, cascade = {.})
    @Cache(usage = ., region="blProducts")
    @OrderBy(value="sequence")
    @AdminPresentationAdornedTargetCollection(friendlyName = "crossSaleProductsTitle", order = 1000,
        tab = ..., tabOrder = ...,
        targetObjectProperty = "relatedSaleProduct"
        sortProperty = "sequence"
        maintainedAdornedTargetFields = { "promotionMessage" }, 
        gridVisibleFields = { "defaultSku.name""promotionMessage" })
    @OneToMany(mappedBy = "product", targetEntity = UpSaleProductImpl.class, cascade = {.})
    @Cache(usage = ., region="blProducts")
    @OrderBy(value="sequence")
    @AdminPresentationAdornedTargetCollection(friendlyName = "upsaleProductsTitle", order = 2000,
        tab = ..., tabOrder = ...,
        targetObjectProperty = "relatedSaleProduct"
        sortProperty = "sequence",
        maintainedAdornedTargetFields = { "promotionMessage" }, 
        gridVisibleFields = { "defaultSku.name""promotionMessage" })
    protected List<RelatedProductupSaleProducts  = new ArrayList<RelatedProduct>();
    @OneToMany(fetch = ., targetEntity = SkuImpl.class, mappedBy="product")
    @Cache(usage = ., region="blProducts")
    @BatchSize(size = 50)
    @AdminPresentationCollection(friendlyName="ProductImpl_Additional_Skus", order = 1000,
        tab = ..., tabOrder = ...)
    protected List<SkuadditionalSkus = new ArrayList<Sku>();
    @ManyToOne(targetEntity = CategoryImpl.class)
    @JoinColumn(name = "DEFAULT_CATEGORY_ID")
    @Index(name="PRODUCT_CATEGORY_INDEX", columnNames={"DEFAULT_CATEGORY_ID"})
    @AdminPresentation(friendlyName = "ProductImpl_Product_Default_Category", order = ..,
        group = ..., groupOrder = ...
        prominent = true, gridOrder = 2, 
        requiredOverride = .)
    protected Category defaultCategory;
    @OneToMany(targetEntity = CategoryProductXrefImpl.class, mappedBy = "product", orphanRemoval = true)
    @OrderBy(value="displayOrder")
    @Cache(usage = ., region="blProducts")
    @BatchSize(size = 50)
    @AdminPresentationAdornedTargetCollection(friendlyName = "allParentCategoriesTitle", order = 3000,
        tab = ..., tabOrder = ...,
        joinEntityClass = "org.broadleafcommerce.core.catalog.domain.CategoryProductXrefImpl",
        targetObjectProperty = "category",
        parentObjectProperty = "product",
        gridVisibleFields = { "name" })
    @ClonePolicyAdornedTargetCollection(unowned = true)
    @OneToMany(mappedBy = "product", targetEntity = ProductAttributeImpl.class, cascade = { . }, orphanRemoval = true)
    @Cache(usage=., region="blProducts")
    @MapKey(name="name")
    @BatchSize(size = 50)
    @AdminPresentationMap(friendlyName = "productAttributesTitle",
        tab = ..., tabOrder = ...,
        deleteEntityUponRemove = true, forceFreeFormKeys = true, keyPropertyFriendlyName = "ProductAttributeImpl_Attribute_Name"
    )
    @OneToMany(targetEntity = ProductOptionXrefImpl.class, mappedBy = "product")
    @Cache(usage = ., region="blProducts")
    @BatchSize(size = 50)
    @AdminPresentationAdornedTargetCollection(friendlyName = "productOptionsTitle",
        tab = ..., tabOrder = ...,
        joinEntityClass = "org.broadleafcommerce.core.catalog.domain.ProductOptionXrefImpl",
        targetObjectProperty = "productOption",
        parentObjectProperty = "product",
        gridVisibleFields = {"label""required"})
    @Embedded
    protected ArchiveStatus archiveStatus = new ArchiveStatus();
    @Override
    public Long getId() {
        return ;
    }
    @Override
    public void setId(Long id) {
        this. = id;
    }
    @Override
    public String getName() {
        return getDefaultSku().getName();
    }
    @Override
    public void setName(String name) {
        getDefaultSku().setName(name);
    }
    @Override
    public String getDescription() {
        return getDefaultSku().getDescription();
    }
    @Override
    public void setDescription(String description) {
        getDefaultSku().setDescription(description);
    }
    @Override
    public String getLongDescription() {
        return getDefaultSku().getLongDescription();
    }
    @Override
    public void setLongDescription(String longDescription) {
        getDefaultSku().setLongDescription(longDescription);
    }
    @Override
    public Date getActiveStartDate() {
        return  getDefaultSku().getActiveStartDate();
    }
    @Override
    public void setActiveStartDate(Date activeStartDate) {
        getDefaultSku().setActiveStartDate(activeStartDate);
    }
    @Override
    public Date getActiveEndDate() {
        return getDefaultSku().getActiveEndDate();
    }
    @Override
    public void setActiveEndDate(Date activeEndDate) {
        getDefaultSku().setActiveEndDate(activeEndDate);
    }
    @Override
    public boolean isActive() {
        if (.isDebugEnabled()) {
            if (!DateUtil.isActive(getActiveStartDate(), getActiveEndDate(), true)) {
                .debug("product, " +  + ", inactive due to date");
            }
            if ('Y'==getArchived()) {
                .debug("product, " +  + ", inactive due to archived status");
            }
        }
        return DateUtil.isActive(getActiveStartDate(), getActiveEndDate(), true) && 'Y'!=getArchived();
    }
    @Override
    public String getModel() {
        return ;
    }
    @Override
    public void setModel(String model) {
        this. = model;
    }
    @Override
    public String getManufacturer() {
        return ;
    }
    @Override
    public void setManufacturer(String manufacturer) {
        this. = manufacturer;
    }
    @Override
    public boolean isFeaturedProduct() {
        return ;
    }
    @Override
    public void setFeaturedProduct(boolean isFeaturedProduct) {
        this. = isFeaturedProduct;
    }
    @Override
    public Sku getDefaultSku() {
        return ;
    }
    
    @Override
    public Boolean getCanSellWithoutOptions() {
        return  == null ? false : ;
    }
    @Override
    public void setCanSellWithoutOptions(Boolean canSellWithoutOptions) {
        this. = canSellWithoutOptions;
    }
    @Override
    public void setDefaultSku(Sku defaultSku) {
        defaultSku.setDefaultProduct(this);
        this. = defaultSku;
    }
    @Override
    public String getPromoMessage() {
        return ;
    }
    @Override
    public void setPromoMessage(String promoMessage) {
        this. = promoMessage;
    }
    
    @Override
    public List<SkugetAllSkus() {
        List<SkuallSkus = new ArrayList<Sku>();
        allSkus.add(getDefaultSku());
        for (Sku additionalSku : ) {
            if (!additionalSku.getId().equals(getDefaultSku().getId())) {
                allSkus.add(additionalSku);
            }
        }
        return allSkus;
    }
    @Override
    public List<SkugetSkus() {
        if (.size() == 0) {
            List<SkuadditionalSkus = getAdditionalSkus();
            for (Sku sku : additionalSkus) {
                if (sku.isActive()) {
                    .add(sku);
                }
            }
        }
        return ;
    }
    @Override
    public List<SkugetAdditionalSkus() {
        return ;
    }
    @Override
    public void setAdditionalSkus(List<Skuskus) {
        this..clear();
        for(Sku sku : skus){
            this..add(sku);
        }
        //this.skus.clear();
    }
    @Override
    public Category getDefaultCategory() {
        return ;
    }
    @Override
    public Map<StringMediagetMedia() {
        return getDefaultSku().getSkuMedia();
    }
    @Override
    public void setMedia(Map<StringMediamedia) {
        getDefaultSku().setSkuMedia(media);
    }
    
    @Override
    public Map<StringMediagetAllSkuMedia() {
        Map<StringMediaresult = new HashMap<StringMedia>();
        result.putAll(getMedia());
        for (Sku additionalSku : getAdditionalSkus()) {
            if (!additionalSku.getId().equals(getDefaultSku().getId())) {
                result.putAll(additionalSku.getSkuMedia());
            }
        }
        return result;
    }
    @Override
    public void setDefaultCategory(Category defaultCategory) {
        this. = defaultCategory;
    }
    @Override
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blProductEntityExtensionManager")) {
            ProductEntityExtensionManager extensionManager = (ProductEntityExtensionManagercontext.getAdditionalProperties().get("blProductEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getAllParentCategoryXrefs(thisholder);
            if (..equals(result)) {
                return (List<CategoryProductXref>) holder.getResult();
            }
        }
        return ;
    }
    @Override
    public void setAllParentCategoryXrefs(List<CategoryProductXrefallParentCategories) {
        this..clear();
        .addAll(allParentCategories);
    }
    @Override
    @Deprecated
    public List<CategorygetAllParentCategories() {
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blProductEntityExtensionManager")) {
            ProductEntityExtensionManager extensionManager = (ProductEntityExtensionManagercontext.getAdditionalProperties().get("blProductEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getAllParentCategories(thisholder);
            if (..equals(result)) {
                return (List<Category>) holder.getResult();
            }
        }
        List<Categoryparents = new ArrayList<Category>();
        for (CategoryProductXref xref : ) {
            parents.add(xref.getCategory());
        }
        return Collections.unmodifiableList(parents);
    }
    @Override
    @Deprecated
    public void setAllParentCategories(List<CategoryallParentCategories) {
        throw new UnsupportedOperationException("Not Supported - Use setAllParentCategoryXrefs()");
    }
    @Override
    public Dimension getDimension() {
        return getDefaultSku().getDimension();
    }
    @Override
    public void setDimension(Dimension dimension) {
        getDefaultSku().setDimension(dimension);
    }
    @Override
    public BigDecimal getWidth() {
        return getDefaultSku().getDimension().getWidth();
    }
    @Override
    public void setWidth(BigDecimal width) {
        getDefaultSku().getDimension().setWidth(width);
    }
    @Override
    public BigDecimal getHeight() {
        return getDefaultSku().getDimension().getHeight();
    }
    @Override
    public void setHeight(BigDecimal height) {
        getDefaultSku().getDimension().setHeight(height);
    }
    @Override
    public BigDecimal getDepth() {
        return getDefaultSku().getDimension().getDepth();
    }
    @Override
    public void setDepth(BigDecimal depth) {
        getDefaultSku().getDimension().setDepth(depth);
    }
    
    @Override
    public BigDecimal getGirth() {
        return getDefaultSku().getDimension().getGirth();
    }
    @Override
    public void setGirth(BigDecimal girth) {
        getDefaultSku().getDimension().setGirth(girth);
    }
    @Override
    public ContainerSizeType getSize() {
        return getDefaultSku().getDimension().getSize();
    }
    @Override
    public void setSize(ContainerSizeType size) {
        getDefaultSku().getDimension().setSize(size);
    }
    @Override
    public ContainerShapeType getContainer() {
        return getDefaultSku().getDimension().getContainer();
    }
    @Override
    public void setContainer(ContainerShapeType container) {
        getDefaultSku().getDimension().setContainer(container);
    }
    @Override
    public String getDimensionString() {
        return getDefaultSku().getDimension().getDimensionString();
    }
    @Override
    public Weight getWeight() {
        return getDefaultSku().getWeight();
    }
    @Override
    public void setWeight(Weight weight) {
        getDefaultSku().setWeight(weight);
    }
    @Override
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blProductEntityExtensionManager")) {
            ProductEntityExtensionManager extensionManager = (ProductEntityExtensionManagercontext.getAdditionalProperties().get("blProductEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getCrossSaleProducts(thisholder);
            if (..equals(result)) {
                return (List<RelatedProduct>) holder.getResult();
            }
        }
        return ;
    }
    @Override
    public void setCrossSaleProducts(List<RelatedProductcrossSaleProducts) {
        this..clear();
        for(RelatedProduct relatedProduct : crossSaleProducts){
            this..add(relatedProduct);
        }       
    }
    @Override
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blProductEntityExtensionManager")) {
            ProductEntityExtensionManager extensionManager = (ProductEntityExtensionManagercontext.getAdditionalProperties().get("blProductEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getUpSaleProducts(thisholder);
            if (..equals(result)) {
                return (List<RelatedProduct>) holder.getResult();
            }
        }
        return ;
    }
    @Override
    public void setUpSaleProducts(List<RelatedProductupSaleProducts) {
        this..clear();
        for(RelatedProduct relatedProduct : upSaleProducts){
            this..add(relatedProduct);
        }
        this. = upSaleProducts;
    }
    
    @Override
        List<RelatedProductreturnProducts = getCrossSaleProducts();
        if ( != null) {
            List<RelatedProductcategoryProducts = .getCumulativeCrossSaleProducts();
            if (categoryProducts != null) {
                returnProducts.addAll(categoryProducts);
            }
        }
        Iterator<RelatedProductitr = returnProducts.iterator();
        while(itr.hasNext()) {
            RelatedProduct relatedProduct = itr.next();
            if (relatedProduct.getRelatedProduct().equals(this)) {
                itr.remove();
            }
        }
        return returnProducts;
    }
    
    @Override
        List<RelatedProductreturnProducts = getUpSaleProducts();
        if ( != null) {
            List<RelatedProductcategoryProducts = .getCumulativeUpSaleProducts();
            if (categoryProducts != null) {
                returnProducts.addAll(categoryProducts);
            }
        }
        Iterator<RelatedProductitr = returnProducts.iterator();
        while(itr.hasNext()) {
            RelatedProduct relatedProduct = itr.next();
            if (relatedProduct.getRelatedProduct().equals(this)) {
                itr.remove();
            }
        }
        return returnProducts;
    }
    @Override
        return ;
    }
    @Override
    public void setProductAttributes(Map<StringProductAttributeproductAttributes) {
        this. = productAttributes;
    }
    @Override
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blProductEntityExtensionManager")) {
            ProductEntityExtensionManager extensionManager = (ProductEntityExtensionManagercontext.getAdditionalProperties().get("blProductEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getProductOptionXrefs(thisholder);
            if (..equals(result)) {
                return (List<ProductOptionXref>) holder.getResult();
            }
        }
        return ;
    }
    @Override
    public void setProductOptionXrefs(List<ProductOptionXrefproductOptions) {
        this. = productOptions;
    }
    @Override
    public List<ProductOptiongetProductOptions() {
        BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
        if (context != null && context.getAdditionalProperties().containsKey("blProductEntityExtensionManager")) {
            ProductEntityExtensionManager extensionManager = (ProductEntityExtensionManagercontext.getAdditionalProperties().get("blProductEntityExtensionManager");
            ExtensionResultHolder holder = new ExtensionResultHolder();
            ExtensionResultStatusType result = extensionManager.getProxy().getProductOptions(thisholder);
            if (..equals(result)) {
                return (List<ProductOption>) holder.getResult();
            }
        }
        List<ProductOptionresponse = new ArrayList<ProductOption>();
        for (ProductOptionXref xref : ) {
            response.add(xref.getProductOption());
        }
        return Collections.unmodifiableList(response);
    }
    @Override
    public void setProductOptions(List<ProductOptionproductOptions) {
        throw new UnsupportedOperationException("Use setProductOptionXrefs(..) instead");
    }
    
    @Override
    public String getUrl() {
        if ( == null) {
            return getGeneratedUrl();
        } else {
            return ;
        }
    }
    
    @Override
    public void setUrl(String url) {
        this. = url;
    }
    
    @Override
    public String getDisplayTemplate() {
        return ;
    }
    
    @Override
    public void setDisplayTemplate(String displayTemplate) {
        this. = displayTemplate;
    }
    @Override
    public Character getArchived() {
        if ( == null) {
             = new ArchiveStatus();
        }
        return .getArchived();
    }
    @Override
    public void setArchived(Character archived) {
        if ( == null) {
             = new ArchiveStatus();
        }
        .setArchived(archived);
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + (( == null) ? 0 : .hashCode());
        return result;
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        ProductImpl other = (ProductImplobj;
        if ( != null && other.id != null) {
            return .equals(other.id);
        }
        if ( == null) {
            if (other.skus != null)
                return false;
        } else if (!.equals(other.skus))
            return false;
        return true;
    }
    @Override
    public String getUrlKey() {
        if ( != null) {
            return ;
        } else {
            if (getName() != null) {
                String returnKey = getName().toLowerCase();
                
                returnKey = returnKey.replaceAll(" ","-");
                return returnKey.replaceAll("[^A-Za-z0-9/-]""");
            }
        }
        return null;
    }
    @Override
    public void setUrlKey(String urlKey) {
        this. = urlKey;
    }
    @Override
    public String getGeneratedUrl() {       
        if (getDefaultCategory() != null && getDefaultCategory().getGeneratedUrl() != null) {
            String generatedUrl = getDefaultCategory().getGeneratedUrl();
            if (generatedUrl.endsWith("//")) {
                return generatedUrl + getUrlKey();
            } else {
                return generatedUrl + "//" + getUrlKey();
            }                       
        }
        return null;
    }
    @Override
    public void clearDynamicPrices() {
        for (Sku sku : getAllSkus()) {
            sku.clearDynamicPrices();
        }
    }
    
    @Override
    public String getMainEntityName() {
        String manufacturer = getManufacturer();
        return StringUtils.isBlank(manufacturer) ? getName() : manufacturer + " " + getName();
    }
    
    public static class Presentation {
        public static class Tab {
            public static class Name {
                public static final String Marketing = "ProductImpl_Marketing_Tab";
                public static final String Media = "SkuImpl_Media_Tab";
                public static final String ProductOptions = "ProductImpl_Product_Options_Tab";
                public static final String Inventory = "ProductImpl_Inventory_Tab";
                public static final String Shipping = "ProductImpl_Shipping_Tab";
                public static final String Advanced = "ProductImpl_Advanced_Tab";
            }
            
            public static class Order {
                public static final int Marketing = 2000;
                public static final int Media = 3000;
                public static final int ProductOptions = 4000;
                public static final int Inventory = 5000;
                public static final int Shipping = 6000;
                public static final int Advanced = 7000;
            }
        }
            
        public static class Group {
            public static class Name {
                public static final String General = "ProductImpl_Product_Description";
                public static final String Price = "SkuImpl_Price";
                public static final String ActiveDateRange = "ProductImpl_Product_Active_Date_Range";
                public static final String Advanced = "ProductImpl_Advanced";
                public static final String Inventory = "SkuImpl_Sku_Inventory";
                public static final String Badges = "ProductImpl_Badges";
                public static final String Shipping = "ProductWeight_Shipping";
                public static final String Financial = "ProductImpl_Financial";
            }
            
            public static class Order {
                public static final int General = 1000;
                public static final int Price = 2000;
                public static final int ActiveDateRange = 3000;
                public static final int Advanced = 1000;
                public static final int Inventory = 1000;
                public static final int Badges = 1000;
                public static final int Shipping = 1000;
            }
        }
        public static class FieldOrder {
            public static final int NAME = 1000;
            public static final int SHORT_DESCRIPTION = 2000;
            public static final int PRIMARY_MEDIA = 3000;
            public static final int LONG_DESCRIPTION = 4000;
            public static final int DEFAULT_CATEGORY = 5000;
            public static final int MANUFACTURER = 6000;
            public static final int URL = 7000;
        }
    }
    @Override
    public String getTaxCode() {
        return getDefaultSku().getTaxCode();
    }
    @Override
    public void setTaxCode(String taxCode) {
        getDefaultSku().setTaxCode(taxCode);
    }
    @Override
    public String getLocation() {
        return getUrl();
    }