private String id;
/**小图,130px**/
private String smallImagePath; /**画廊上显示的图片,753px**/ private String midImagePath; /**放大后的图片效果900px**/ private String bigImagePath; /**图片对应产品**/ private ProductInfo product; public ProductImgGroup(){} public ProductImgGroup(String id) {
}
super(); this.id = id;
@Id @Column(length=36)
public String getId() { }
public void setId(String id) { }
@Column(length=200)
public String getSmallImagePath() { }
public void setSmallImagePath(String smallImagePath) {
this.smallImagePath = smallImagePath;
第21页(共49页)
return smallImagePath; this.id = id; return id;
}
@Column(length=200)
public String getMidImagePath() { }
public void setMidImagePath(String midImagePath) { }
@Column(length=200)
public String getBigImagePath() { }
public void setBigImagePath(String bigImagePath) { }
@ManyToOne(cascade=CascadeType.REFRESH,optional=false) @JoinColumn(name=\public ProductInfo getProduct() { }
public void setProduct(ProductInfo product) { }
@Override
public int hashCode() {
final int prime = 31; int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
第22页(共49页)
this.product = product; return product;
this.bigImagePath = bigImagePath; return bigImagePath;
this.midImagePath = midImagePath;
return midImagePath;
}
}
return result;
@Override
public boolean equals(Object obj) { }
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final ProductImgGroup other = (ProductImgGroup) obj; if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
④品牌实体 /**品牌**/
@Entity @Searchable(root=false)
public class Brand implements Serializable{
private static final long serialVersionUID = -4540465642606278764L; /**主键**/ private Integer id; /** 品牌名称 **/ private String name;
/** logo图片路径 如:/images/brand/2015/12/12/ooo.gif\private String logopath;
第23页(共49页)
public Brand() {}
public Brand(String name, String logopath) { } @Id
@GeneratedValue
@SearchableProperty(index=Index.NO,
this.name = name; this.logopath = logopath;
store=Store.YES)
public void setId(Integer id) { }
@Column(length=40,
nullable=false)
this.id = id; public Integer getId() { }
return id;
@SearchableProperty(index=Index.NOT_ANALYZED, store=Store.YES,name=\
public String getName() { }
public void setName(String name) { }
@Column(length=80) public String getLogopath() { }
public void setLogopath(String logopath) {
第24页(共49页)
return logopath; this.name = name; return name;