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;
 
 
 
The Class CategoryProductXrefImpl is the default implmentation of Category. This entity is only used for executing a named query. 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 class then you should implement your own version of Category.

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

Author(s):
btaylor
See also:
Category, ProductImpl
 
 @Table(name = "BLC_CATEGORY_PRODUCT_XREF")
 @AdminPresentationClass(excludeFromPolymorphism = false)
 @Cache(usage = ., region="blCategories")
         @DirectCopyTransformMember(templateTokens = ., skipOverlaps=true),
 })
 public class CategoryProductXrefImpl implements CategoryProductXref {

    
The Constant serialVersionUID.
 
     private static final long serialVersionUID = 1L;
 
     @Id
     @GeneratedValue(generator= "CategoryProductId")
     @GenericGenerator(
         name="CategoryProductId",
         strategy="org.broadleafcommerce.common.persistence.IdOverrideTableGenerator",
         parameters = {
             @Parameter(name="segment_value", value="CategoryProductXrefImpl"),
             @Parameter(name="entity_name", value="org.broadleafcommerce.core.catalog.domain.CategoryProductXrefImpl")
         }
     )
     @Column(name = "CATEGORY_PRODUCT_ID")
     protected Long id;
 
     @ManyToOne(targetEntity = CategoryImpl.class, optional=false)
     @JoinColumn(name = "CATEGORY_ID")
     protected Category category = new CategoryImpl();

    
The product.
 
     @ManyToOne(targetEntity = ProductImpl.class, optional=false)
     @JoinColumn(name = "PRODUCT_ID")
     protected Product product = new ProductImpl();

    
The display order.
    @Column(name = "DISPLAY_ORDER", precision = 10, scale = 6)
    protected BigDecimal displayOrder;
    public BigDecimal getDisplayOrder() {
        return ;
    }
    public void setDisplayOrder(BigDecimal displayOrder) {
        this. = displayOrder;
    }
    public Category getCategory() {
        return ;
    }
    public void setCategory(Category category) {
        this. = category;
    }
    public Product getProduct() {
        return ;
    }
    public void setProduct(Product product) {
        this. = product;
    }
    public Long getId() {
        return ;
    }
    public void setId(Long id) {
        this. = id;
    }
    @Override
    public boolean equals(Object o) {
        if (this == oreturn true;
        if (!(o instanceof CategoryProductXrefImpl)) return false;
        CategoryProductXrefImpl that = (CategoryProductXrefImplo;
        if ( != null ? !.equals(that.category) : that.category != nullreturn false;
        if ( != null ? !.equals(that.product) : that.product != nullreturn false;
        return true;
    }
    @Override
    public int hashCode() {
        int result =  != null ? .hashCode() : 0;
        result = 31 * result + ( != null ? .hashCode() : 0);
        return result;
    }
New to GrepCode? Check out our FAQ X