/**定金**/
private Float barginMoney; /** 是否可见 **/ private Boolean visible = true;
/** 产品类型(大型车,中型车....) **/ private ProductType type; /** 上架日期 **/
private Date createdate = new Date(); /** 人气指数 **/ private Integer clickcount = 1; /** 销售量 **/
private Integer sellcount = 0; /**是否最新车型**/ private Boolean isNew=false; /**是否热销车型**/ private Boolean isHot=false; /** 是否推荐(活动车型) **/ private Boolean isActivity=false; /** 产品样式 **/
private Set
Set
viewImages=new
HashSet
/**产品评价**/
private Set
public ProductInfo() {}
第9页(共49页)
public ProductInfo(String productCode) { }
this.code=productCode;
@OneToMany(cascade={CascadeType.ALL}, mappedBy=\@SearchableComponent
public Set
public void setStyles(Set
* 从样式集合中删除指定样式 * @param style */
public void removeProductStyle(ProductStyle style){ }
if(this.styles.contains(style)){ }
this.styles.remove(style); style.setProduct(null); this.styles = styles; return styles;
/**
* 添加样式到样式集合 * @param style */
public void addProductStyle(ProductStyle style){
if(!this.styles.contains(style)){
this.styles.add(style);
第10页(共49页)
}
style.setProduct(this);
} /**
* 添加图片组到集合 * @param style */
public void addImageGroup(ProductImgGroup group){ }
if(!this.viewImages.contains(group)){ }
this.viewImages.add(group); group.setProduct(this);
@Id @SearchableId public String getCode() { }
public void setCode(String code) { }
@Column(length=50,nullable=false)
@SearchableProperty(boost=2,name=\public String getName() { }
public void setName(String name) { }
@ManyToOne(cascade=CascadeType.REFRESH)
第11页(共49页)
this.name = name; return name; this.code = code; return code;
YES)
@JoinColumn(name=\public Brand getBrand() { }
public void setBrand(Brand brand) { }
this.brand = brand;
return brand;
@Column(nullable=false)@SearchableProperty(index=Index.NO,store=Store.
public String getInnerSellPrice() { }
@Transient @SearchableProperty(index=Index.NO,store=Store.YES) public Integer getInventory(){ }
public void setInnerSellPrice(String innerSellPrice) { }
@Lob @Column(nullable=false) @SearchableProperty public String getDescription() { }
public void setDescription(String description) {
this.description = description;
第12页(共49页)
return description;
this.innerSellPrice = innerSellPrice; Integer inventory=0;
for(ProductStyle style:getStyles()){ }
return inventory;
inventory+=style.getInventory(); return innerSellPrice;