org.broadleafcommerce.core.catalog.domain.FeaturedProductImpl Maven / Gradle / Ivy
/*
* Copyright 2008-2013 the original author or authors.
*
* 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.
*/
package org.broadleafcommerce.core.catalog.domain;
import org.broadleafcommerce.common.presentation.AdminPresentation;
import org.broadleafcommerce.common.presentation.client.VisibilityEnum;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Index;
import org.hibernate.annotations.Parameter;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "BLC_PRODUCT_FEATURED")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region="blStandardElements")
public class FeaturedProductImpl implements FeaturedProduct {
private static final long serialVersionUID = 1L;
/** The id. */
@Id
@GeneratedValue(generator= "FeaturedProductId")
@GenericGenerator(
name="FeaturedProductId",
strategy="org.broadleafcommerce.common.persistence.IdOverrideTableGenerator",
parameters = {
@Parameter(name="segment_value", value="FeaturedProductImpl"),
@Parameter(name="entity_name", value="org.broadleafcommerce.core.catalog.domain.FeaturedProductImpl")
}
)
@Column(name = "FEATURED_PRODUCT_ID")
protected Long id;
@Column(name = "SEQUENCE")
@AdminPresentation(visibility = VisibilityEnum.HIDDEN_ALL)
protected Long sequence;
@Column(name = "PROMOTION_MESSAGE")
@AdminPresentation(friendlyName = "FeaturedProductImpl_Featured_Product_Promotion_Message", largeEntry=true)
protected String promotionMessage;
@ManyToOne(targetEntity = CategoryImpl.class)
@JoinColumn(name = "CATEGORY_ID")
@Index(name="PRODFEATURED_CATEGORY_INDEX", columnNames={"CATEGORY_ID"})
protected Category category = new CategoryImpl();
@ManyToOne(targetEntity = ProductImpl.class)
@JoinColumn(name = "PRODUCT_ID")
@Index(name="PRODFEATURED_PRODUCT_INDEX", columnNames={"PRODUCT_ID"})
protected Product product = new ProductImpl();
@Override
public Long getId() {
return id;
}
@Override
public void setId(Long id) {
this.id = id;
}
@Override
public void setSequence(Long sequence) {
this.sequence = sequence;
}
@Override
public Long getSequence() {
return this.sequence;
}
@Override
public String getPromotionMessage() {
return promotionMessage;
}
@Override
public void setPromotionMessage(String promotionMessage) {
this.promotionMessage = promotionMessage;
}
@Override
public Category getCategory() {
return category;
}
@Override
public void setCategory(Category category) {
this.category = category;
}
@Override
public Product getProduct() {
return product;
}
@Override
public void setProduct(Product product) {
this.product = product;
}
@Override
public Product getRelatedProduct() {
return product;
}
}