再谈compass:集成站内搜索 - 编程入门网
izable{
private static final long serialVersionUID = 8106351120886053881L;
/** 类别id **/
private Integer typeid;
/** 类别名称 **/
private String name;
/** 子类别 **/
private Set<ProductType> childtypes = new HashSet<ProductType>();
/** 所属父类 **/
private ProductType parent;
private Set<ProductInfo> products = new HashSet<ProductInfo>();
@OneToMany(mappedBy="type", cascade=CascadeType.REMOVE)
@SearchableReference
public Set<ProductInfo> getProducts() {
return products;
}
public void setProducts(Set<ProductInfo> products) {
this.products = products;
}
public ProductType() {}
@ManyToOne(cascade=CascadeType.REFRESH)
@JoinColumn(name="parentid")
public ProductType getParent() {
return parent;
}
public void setParent(ProductType parent) {
this.parent = parent;
}
@OneToMany(cascade={CascadeType.REFRESH,CascadeType.REMOVE},mappedBy="parent")
public Set<ProductType> getChildtypes() {
return childtypes;
}
public void setChildtypes(Set<ProductType> childtypes) {
this.childtypes = childtypes;
}
@Column(length=36,nullable=false)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Id @GeneratedValue(strategy=GenerationType.AUTO)
@SearchableId
public Integer getTypeid() {
return typeid;
}
public void setTypeid(Integer typeid) {
this.typeid = typeid;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((typeid == null) ? 0 : typeid.hashCode());
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 ProductType other = (ProductType) obj;
if (typeid == null) {
if (other.typeid != null)
return false;
} else if (!typeid.equals(other.typeid))
return false;
return true;
}
}
再谈compass:集成站内搜索(3)时间:2011-01-05 javaeye lqw8668ProductStyle.java Java代码
|
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |