步骤 2 : 相关功能页面截图-理解ProductImage 步骤 3 : 相关功能页面截图-理解reviewCount,saleCount
1. 与数据库相关字段一一对应的基本属性
2. 与Category的多对一关系 3. 与ProductImage的一对多关系 4. firstProductImage这个属性,是从productSingleImages集合中取出第一个来,用于显示这个产品的默认图片。 5. reviewCount, saleCount 这两个字段,分别表示评价数量和销售数量,并不是在数据库中对应的字段。 注:截至目前为止,还没有ProductImage类,所以暂时会编译错误,下一个知识点就会提供ProductImage类了 package tmall.bean;
import java.util.Date;
import java.util.List;
public class Product {
private String name;
private String subTitle;
private float orignalPrice;
private float promotePrice;
private int stock;
private Date createDate;
private Category category;
private int id;
private ProductImage firstProductImage;
private List<ProductImage> productImages;
private List<ProductImage> productSingleImages;
private List<ProductImage> productDetailImages;
private int reviewCount;
private int saleCount;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSubTitle() {
return subTitle;
}
public void setSubTitle(String subTitle) {
this.subTitle = subTitle;
}
public float getOrignalPrice() {
return orignalPrice;
}
public void setOrignalPrice(float orignalPrice) {
this.orignalPrice = orignalPrice;
}
public float getPromotePrice() {
return promotePrice;
}
public void setPromotePrice(float promotePrice) {
this.promotePrice = promotePrice;
}
public int getStock() {
return stock;
}
public void setStock(int stock) {
this.stock = stock;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String toString(){
return name;
}
public ProductImage getFirstProductImage() {
return firstProductImage;
}
public void setFirstProductImage(ProductImage firstProductImage) {
this.firstProductImage = firstProductImage;
}
public List<ProductImage> getProductImages() {
return productImages;
}
public void setProductImages(List<ProductImage> productImages) {
this.productImages = productImages;
}
public List<ProductImage> getProductSingleImages() {
return productSingleImages;
}
public void setProductSingleImages(List<ProductImage> productSingleImages) {
this.productSingleImages = productSingleImages;
}
public List<ProductImage> getProductDetailImages() {
return productDetailImages;
}
public void setProductDetailImages(List<ProductImage> productDetailImages) {
this.productDetailImages = productDetailImages;
}
public int getReviewCount() {
return reviewCount;
}
public void setReviewCount(int reviewCount) {
this.reviewCount = reviewCount;
}
public int getSaleCount() {
return saleCount;
}
public void setSaleCount(int saleCount) {
this.saleCount = saleCount;
}
}
单个产品图片集合 productSingleImages
详情产品集合:productDetailImages
HOW2J公众号,关注后实时获知最新的教程和优惠活动,谢谢。
提问之前请登陆
提问已经提交成功,正在审核。 请于 我的提问 处查看提问记录,谢谢
|