81,094
社区成员
发帖
与我相关
我的任务
分享
//这是商品表实体;
public class Goods implements java.io.Serializable {
// Fields
private Long goodsId;
private Set bids = new HashSet(0);//这是商品拍卖信息集合;
................
}
//这是拍卖信息实体;
public class Bid implements java.io.Serializable {
// Fields
private Long bidId;
private Goods goods;
}
public List<Goods> getGoodsList(Goods condition, Integer pageNum,
Integer pageSize, boolean isHot) {
DetachedCriteria dc = DetachedCriteria.forClass(Goods.class);
dc.add(Example.create(condition).enableLike());
dc.setFetchMode("bids", FetchMode.EAGER);
if (isHot) {//isHot是否热拍商品
//这个地方的代码哪个会啊
}
List<Goods> list = null;
if (pageSize != null && pageNum != null) {
int fromIndex = pageSize * (pageNum - 1);
list = this.getHibernateTemplate().findByCriteria(dc, fromIndex,
pageSize);
} else {
list = this.getHibernateTemplate().findByCriteria(dc);
}
return list;
}